This example adds a right-aligned page number to the primary footer in the first section in the active document.
With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary)
.PageNumbers.Add PageNumberAlignment:=wdAlignPageNumberRight
End With