File Names

  • Thread starter Thread starter Colin Doyle
  • Start date Start date
C

Colin Doyle

Once I have saved a document and allocated a file name,
how do I automatically insert the file name into the
document so that I can easily trace it at a later stage

Thanks
 
Colin,

There is a Word Field Code {FileName} for doing this. You can also use one
of the AUTOTEXT entries. Insert>AutoText>Headers and Footer>File Name or
File Name and Path.
 
Do know of anyway to set up the filename/p field to update itself automaticaly when you save the document in another location?
 
emce10282,

I am not a VBA expert by any means, but I have cobbled together the
following from code developed by other people, This macor replaces the
normal SAVEAS command and does two things

1) Puts the Filename on the title bar
2) Updates document fields after the save.

Sub FileSaveAs()

SendKeys "+{TAB}"
Dialogs(wdDialogFileSaveAs).Show
System.Cursor = wdCursorNormal
ActiveWindow.Caption = ActiveDocument.FullName
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType < wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub
 
Back
Top