Hi Karen,
Another solution could be this one.
Sub Auto_Open()
Dim DocName As String
Dim BMRange_DocName As Range
DocName = ActiveDocument.Name ' get the name of the active document
Set BMRange_DocName = ActiveDocument.Bookmarks("DocName").Range ' go to the
bookmark
BMRange_DocName.Text = Left(DocName, Len(DocName) - 4) ' overwrite it with
the filename
ActiveDocument.Bookmarks.Add "DocName", BMRange_DocName ' restores the
bookmark
End Sub
You need to add a bookmark to your document, bookmarkname DocName.
This code will find your bookmark, update it with to documentname (without
extension),
and makes sure the bookmark is restored.
Kind regards,
Bert
Quote:
> Not really mailmerge - but hope someone can help.
> Win95 & Word97.
> I have several templates where "my reference" is a field to show the file
> name. I don't want it to show the .doc file extension. Have reset all
> folders in Windows Explorer to "hide known file extensions" and restarted -
> but they keep reappearing!!
> There doesn't seem to be a switch to hide the extension - is there are VBA
> tweak?
> Also, do you think the template might "remember" that I might not have had
> "hide file extensions" checked when I originally created it? If so, would
> seem edit of template might work - but tedious.