J
jerem
Scavenged some code and changed it a bit, however, need to have the FileName
come into the footer as a Font Size of 8 pt. Thanks in advance for your help.
Sub NumberPages2()
'
' PageNumbersEveryPage Macro
'
Dim oRng As Range
Dim oSection As Section
Dim oFooter As HeaderFooter
Call SameAsPrevious
For Each oSection In ActiveDocument.Sections
For Each oFooter In oSection.Footers
If oFooter.Exists Then
Set oRng = oFooter.Range
With oRng
.Fields.Add oRng, wdFieldPage, , False
.InsertBefore "-"
.InsertAfter "-"
.Collapse wdCollapseEnd
.ParagraphFormat.Alignment = _
wdAlignParagraphCenter
.Fields.Add oRng, wdFieldFileName
.InsertAfter Chr(13)
.Collapse wdCollapseEnd
.ParagraphFormat.Alignment = _
wdAlignParagraphLeft
End With
End If
Next oFooter
Next oSection
End Sub
come into the footer as a Font Size of 8 pt. Thanks in advance for your help.
Sub NumberPages2()
'
' PageNumbersEveryPage Macro
'
Dim oRng As Range
Dim oSection As Section
Dim oFooter As HeaderFooter
Call SameAsPrevious
For Each oSection In ActiveDocument.Sections
For Each oFooter In oSection.Footers
If oFooter.Exists Then
Set oRng = oFooter.Range
With oRng
.Fields.Add oRng, wdFieldPage, , False
.InsertBefore "-"
.InsertAfter "-"
.Collapse wdCollapseEnd
.ParagraphFormat.Alignment = _
wdAlignParagraphCenter
.Fields.Add oRng, wdFieldFileName
.InsertAfter Chr(13)
.Collapse wdCollapseEnd
.ParagraphFormat.Alignment = _
wdAlignParagraphLeft
End With
End If
Next oFooter
Next oSection
End Sub