A family of Microsoft word processing software products for creating web, email, and print documents.
After the line that starts with n = , insert this line:
ActiveDocument.Styles("Footer").Font.Size = 9
That will affect all footers in the document.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi - I'm using some code (that helpfully was found in this community!!!! Thanks Graham!) to insert a footer - I can't figure out how to make the font size change to 9 (just for the footer).
Dim n As String
Dim rG As Range
Dim iRM As Long
n = "File Number " & FNumberTextBox.Text
With ActiveDocument.Sections(1)
With .PageSetup
iRM = .PageWidth - .RightMargin - .LeftMargin
.DifferentFirstPageHeaderFooter = False
End With
Set rG = .Footers(wdHeaderFooterPrimary).Range
rG.Text = "Page "
rG.Collapse wdCollapseEnd
ActiveDocument.Fields.Add rG, wdFieldPage, , False
rG.Start = .Footers(wdHeaderFooterPrimary).Range.End
rG.Text = " of "
rG.Collapse wdCollapseEnd
ActiveDocument.Fields.Add rG, wdFieldNumPages, , False
rG.Start = .Footers(wdHeaderFooterPrimary).Range.End
With rG.Paragraphs(1).TabStops
.ClearAll
.Add Position:=iRM, Alignment:=wdAlignTabRight
End With
rG.Text = vbTab & n
.Footers(wdHeaderFooterPrimary).Range.Fields.Update
End With
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
After the line that starts with n = , insert this line:
ActiveDocument.Styles("Footer").Font.Size = 9
That will affect all footers in the document.
Answer accepted by question author
Also, the line of code I gave does modify the Footer style, although only in the current document. It would be possible, but not advisable, to have the macro also modify the Footer style of the document's template (and of Normal.dotm, if that isn't what the document is based on).
The style for footers is Footer. Footnote Text is for the text in footnotes.
After the line that starts with n = , insert this line:
ActiveDocument.Styles("Footer").Font.Size = 9
That will affect all footers in the document.
Thankyou - worked perfectly (you already knew that LOL)
James