Hi,
I want a macro to add a footer with the page number on the right, the distance from the bottom (1cm), the style of footer text (Times new roman, 14pt), I tried and used this macro, but didn't fulfill my requirement
Code:
Sub AddFooterWithPageNumber()
Dim section As section
Dim footer As range
' Loop through each section in the document
For Each section In ActiveDocument.Sections
Set footer = section.Footers(wdHeaderFooterPrimary).range
' Clear existing content in the footer
footer.Text = ""
' Set font properties
With footer.Font
.Name = "Times New Roman"
.Size = 14
End With
Dim positionFromBottom As Double
positionFromBottom = CentimetersToPoints(1)
footer.Fields.Add range:=footer, Type:=wdFieldPage
' footer.Text = " - " ' Uncomment this line if you want to add a separator
' Update the footer
' footer.Updates
Next section
End Sub
Any help, suggestions
Thanks