Footer field (filename) changes font size Word 2007

J

JGT

I really have two questions - I'm running Word 2007 Enterprise on my Vista
Business x64 system.
(Q1) In my normal.dotm I've added a footer that contains a field (Filename)
and the page number "Page X of Y". Is there a way that I can get the field
(Filename) to automatically update when the file is saved? Currently I open
the footer, position my cursor next to the filename and press F9 to update
the document with the filename of the document.
(Q2) The footer in the template font size is 8pt, when I press F9 to update
the filename, part of the filename font size will change. How do I force it
to stay at 8pt?
 
G

Graham Mayor

Several issues here

1. It is not a good idea to put fields (or anything else) in the
header/footer of the normal template. Not only does it not work as you
intend, because the field will not update automatically, but it interferes
with the use of the normal template for some of its base functions, eg
making labels.
The better options are to create a document template and use that for those
documents that require a filename etc., or to insert the header/footer using
a macro. eg

Sub AddFooter()
Dim oFooter As Range
Dim oRng As Range
Set oFooter =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range
If Len(ActiveDocument.Path) = 0 Then
ActiveDocument.Save
End If
oFooter.Select
Set oRng = Selection.Range
With Selection
.Paragraphs.Alignment = wdAlignParagraphCenter
.TypeText "Page "
.Fields.Add Range:=Selection.Range, _
Type:=wdFieldPage, _
PreserveFormatting:=False
.TypeText " of "
.Fields.Add Range:=Selection.Range, _
Type:=wdFieldNumPages, _
PreserveFormatting:=False
.TypeParagraph
.Paragraphs.Alignment = wdAlignParagraphRight
.Fields.Add Range:=Selection.Range, _
Type:=wdFieldFileName, _
Text:="\p", _
PreserveFormatting:=False
End With
oRng.End = Selection.Range.End
oRng.Font.name = "Arial"
oRng.Font.Size = 8
With ActiveDocument.ActiveWindow
.View = wdPrintView
.View.SeekView = wdSeekMainDocument
.View = wdPrintView
End With
End Sub
http://www.gmayor.com/installing_macro.htm

2. You can update fields using the sample macro at
http://www.gmayor.com/installing_macro.htm attached to a button on the QAT
(Quick Access Toolbar)

3. To retain the formatting of the field, add a charformat switch (in place
of any mergeformat switch that may be there)-
http://www.gmayor.com/formatting_word_fields.htm .The macro above will
format the footer as 8 points Arial


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


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

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

Top