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 » Page Layout
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Footer field (filename) changes font size Word 2007



 
 
Thread Tools Display Modes
  #1  
Old March 9th, 2009, 06:38 AM posted to microsoft.public.word.pagelayout
JGT
external usenet poster
 
Posts: 124
Default Footer field (filename) changes font size Word 2007

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?
  #2  
Old March 9th, 2009, 07:12 AM posted to microsoft.public.word.pagelayout
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Footer field (filename) changes font size Word 2007

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(wdHeaderFooterP rimary).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

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



JGT wrote:
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?



 




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 01:36 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.