Place the Cursor in the footer.
On the toolbar, select Insert/Field
Under field names, select Filename
In Field options check the Add path to filename check box
Click OK.
If you want just the path, you need a macro. The following will insert the
path at the cursor. As you don't get a path until the document has been
saved, the macro will force a save if required.
Sub InsertPath()
Dim pPathname As String
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
pPathname = .Path
End With
Selection.TypeText pPathname
End Sub
The following inserts the path and the filename (though a {filename \p}
field will also do that if you prefer.
Sub InsertFileNameAndPath()
Dim fFname As String
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
fFname = .FullName
End With
Selection.TypeText fFname
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.