This looks like recorded code. When recording a macro, Word does not know
what you change in a dialog and so records all the settings - you can (and
should) delete the settings you don't want changed. In this case I guess all
you need keep is:
Sub page()
' With ActiveDocument.PageSetup
.PageWidth = CentimetersToPoints(20.3)
.PageHeight = CentimetersToPoints(25.4)
End With
End Sub
If that doesn't make all the changes you want you may have to either
experiment or look at them each in turn and make a decision based on your
knowledge of your requirements.
I see that the statement "With ActiveDocument.PageSetup" is commented out.
As it won't work like that I presume it is a typo.
--
Enjoy,
Tony
> I need to write VBA code to change the page setup from A4 to quarto when a
> certain button is pressed. Is there a shorter code than the one below?
[quoted text clipped - 24 lines]
> End With
> End Sub