JH,
This might get you started. Hacked together from code
Doug Robbins posted for FLUSH right. It only affects the
primary footer, so if you run the code and then change
Page Layout Header and Footer sections you will need to
copy the text to the ODD, Even, or First Page footer. I
suppose you could make that automatic with a little more
code:
Sub SetupFooter()
On Error GoTo ErrorHandling
Dim sngLeftMargin As Single
Dim sngRightMargin As Single
Dim sngPageWidth As Single
Dim sngWidthToRight As Single
Dim sngHalfWayPoint As Single
'Retrieve margin, center and page width values
sngLeftMargin = CSng(ActiveDocument.PageSetup.LeftMargin)
sngRightMargin = CSng(ActiveDocument.PageSetup.RightMargin)
sngPageWidth = CSng(ActiveDocument.PageSetup.PageWidth)
sngWidthToRight = sngPageWidth - (sngLeftMargin +
sngRightMargin)
sngHalfWayPoint = sngWidthToRight / 2
Application.ScreenUpdating = False
'Go to footer
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
End If
'Position Tabs Stops
With Selection.Paragraphs.TabStops
.ClearAll
.Add Position:=sngHalfWayPoint,
Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
.Add Position:=sngWidthToRight,
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
End With
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="CREATEDATE"
Selection.MoveRight Unit:=wdCharacter, Count:=3,
Extend:=wdMove
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="PAGE"
Selection.MoveRight Unit:=wdCharacter, Count:=3,
Extend:=wdMove
Selection.TypeText Text:=" of "
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="NUMPAGES"
Selection.MoveRight Unit:=wdCharacter, Count:=3,
Extend:=wdMove
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="FILENAME \p"
Selection.WholeStory
Application.Run
MacroName:="Normal.MyMacros.UpdateFields"
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
Application.ScreenUpdating = True 'display on
ErrorHandling:
End Sub