i want put file name in footer automaticaly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to put a file name in footer autometicaly, when we save file . Just
like bydefolt
 
Insert a FILENAME field in the footer: Click View>Header and Footer to
activate the header/footer area, and place the cursor in the footer.
On the Header/Footer toolbar, click Insert AutoText and then click the
entry referring to file name (or file name and path). To make sure
that the file name is always in the footer of newly created documents,
add the field to the footer of your template.
 
But do NOT add this or any other text to the footer of Normal.dot, as it
will cause problems with labels.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
We used to be able to do this and it was very useful to my organisation. Is
there any way to make them automatically update now? I have been to the
knowledge base and know about f9 and the macro that changes the file name and
path when the file is reopened, but who wants to close and reopen a file
before printing?
Many of my staff will not think of pressing f9 before printing, saving or
closing a file.
 
The only way to show automatically what the filename is in the field, is to
save the document before adding the field.
The field will not update automatically!
Put the following macro in the document template (not normal.dot for reasons
already mentioned by Suzanne) and it will force a save and an update to the
field in the footer when the new document is created.

Sub AutoNew()
Dim oField As Field
Dim oSection As Section
Dim oFooter As HeaderFooter
With ActiveDocument
If Not .Saved Then
.Save
End If
For Each oSection In ActiveDocument.Sections
For Each oFooter In oSection.Footers
If oFooter.Exists Then
For Each oField In oFooter.Range.Fields
oField.Update
Next oField
End If
Next oFooter
Next oSection
End With
End Sub

Alternatively intercept the filesave and filesaveas routines to add the
extra update code after saving.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thank you Graham. Not happy that it can't be added to normal.dot, but that
isn't your fault (or is it? - just teasing)

Dot
 
If you want it for normal.dot name the macro something other than autonew eg
InsertFName() and attach it to a toolbar button. It will not be automatic,
but a click on the button will update the field.
http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

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.

Ask a Question

Back
Top