A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding file path and name to footer



 
 
Thread Tools Display Modes
  #1  
Old August 26th, 2008, 03:25 PM posted to microsoft.public.word.newusers
Ray W[_2_]
external usenet poster
 
Posts: 3
Default Adding file path and name to footer

I am building a template that I would like that file path and name to appear
automatically in the footer (like Excel). Is this possible in Word 2003?
  #2  
Old August 26th, 2008, 03:49 PM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Adding file path and name to footer

It depends on your definition of 'automatically'. You could put a { filename
\p } field in the footer, but the document will not have a name and path
until the document is saved, and when you save it the field will only update
if you force an update. You can use the macro at
http://www.gmayor.com/installing_macro.htm to update the field.

Or you can simply insert the filename and path into the document using a
macro e.g.

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

or into the footer

Sub InsertFileNameAndPath()
Dim fFname As String
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
fFname = .FullName
End With
Selection.EndKey Unit:=wdStory
ActiveWindow.ActivePane.View.SeekView = _
wdSeekCurrentPageFooter
Selection.TypeText fFname
ActiveWindow.ActivePane.View.SeekView = _
wdSeekMainDocument
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Ray W wrote:
I am building a template that I would like that file path and name to
appear automatically in the footer (like Excel). Is this possible in
Word 2003?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.