Examples:
The following VBA example checks whether the active page size is set to letter-sized (8.5" × 11") paper. If it is not letter-sized, the correct values are applied to the
SizeWidth and
SizeHeight values.
Sub Test()
If ActivePage.Paper <> "Letter" Then
ActivePage.SizeWidth = 8.5
ActivePage.SizeHeight = 11
End If
End Sub
The following VBA example displays a warning if the selected paper size is not a standard one. Sub Test()
If ActivePage.Paper = "Custom" Then
MsgBox "Attention: non-standard page size used!"
End If
End Sub