Thread: [Solved] Toggle A4 and Custom size
View Single Post
 
Old 01-20-2019, 04:31 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

try this
Code:
Sub Toggle_Paper_size()
  With ActiveDocument.Styles(wdStyleNormal).Font
    If .NameFarEast = .NameAscii Then .NameAscii = ""
    .NameFarEast = ""
  End With
  With ActiveDocument.PageSetup
    .LineNumbering.Active = False
    .Orientation = wdOrientPortrait
    .TopMargin = CentimetersToPoints(0.63)
    .BottomMargin = CentimetersToPoints(0.5)
    .LeftMargin = CentimetersToPoints(0.95)
    .RightMargin = CentimetersToPoints(0.63)
    .Gutter = CentimetersToPoints(0)
    .HeaderDistance = CentimetersToPoints(0)
    .FooterDistance = CentimetersToPoints(0)
    .FirstPageTray = wdPrinterDefaultBin
    .OtherPagesTray = wdPrinterDefaultBin
    .SectionStart = wdSectionNewPage
    .OddAndEvenPagesHeaderFooter = False
    .DifferentFirstPageHeaderFooter = False
    .VerticalAlignment = wdAlignVerticalTop
    .SuppressEndnotes = False
    .MirrorMargins = False
    .TwoPagesOnOne = False
    .BookFoldPrinting = False
    .BookFoldRevPrinting = False
    .BookFoldPrintingSheets = 1
    .GutterPos = wdGutterPosLeft
    If .PaperSize = wdPaperA4 Then
      .PageWidth = CentimetersToPoints(45.89)
      .PageHeight = CentimetersToPoints(55.87)
    Else
      .PaperSize = wdPaperA4
    End If
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote