S
Sophie
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?
Sub page()
' With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(4)
.BottomMargin = CentimetersToPoints(3.5)
.LeftMargin = CentimetersToPoints(3)
.RightMargin = CentimetersToPoints(2)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.27)
.FooterDistance = CentimetersToPoints(0.81)
.PageWidth = CentimetersToPoints(20.3)
.PageHeight = CentimetersToPoints(25.4)
.FirstPageTray = 116
.OtherPagesTray = 116
.SectionStart = wdSectionContinuous
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
End Sub
certain button is pressed. Is there a shorter code than the one below?
Sub page()
' With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(4)
.BottomMargin = CentimetersToPoints(3.5)
.LeftMargin = CentimetersToPoints(3)
.RightMargin = CentimetersToPoints(2)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.27)
.FooterDistance = CentimetersToPoints(0.81)
.PageWidth = CentimetersToPoints(20.3)
.PageHeight = CentimetersToPoints(25.4)
.FirstPageTray = 116
.OtherPagesTray = 116
.SectionStart = wdSectionContinuous
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
End Sub