The following wapp is a predefined Word document engineering variable.
The following code is for pages with VBA code page margins, paper portrait, Alignment, Header page static, and so on.
WApp.ActiveDocument.PageSetup.LineNumbering.Active =0;//Line number
WApp.ActiveDocument.PageSetup.Orientation =microsoft.office.interop.word.wdorientation.wdorientportrait;//page orientation
WApp.ActiveDocument.PageSetup.TopMargin =wapp.centimeterstopoints (float. Parse ("2.54"))//upper margin
WApp.ActiveDocument.PageSetup.BottomMargin = wapp.centimeterstopoints (float. Parse ("2.54"))//Bottom margin
WApp.ActiveDocument.PageSetup.LeftMargin = wapp.centimeterstopoints (float. Parse ("3.17"))//left margin
WApp.ActiveDocument.PageSetup.RightMargin = wapp.centimeterstopoints (float. Parse ("3.17"))//Right margin
WApp.ActiveDocument.PageSetup.Gutter = wapp.centimeterstopoints (float. Parse ("0"))/Gutter position
WApp.ActiveDocument.PageSetup.HeaderDistance = wapp.centimeterstopoints (float. Parse ("1.5"));//Header
WApp.ActiveDocument.PageSetup.FooterDistance = wapp.centimeterstopoints (float. Parse ("1.75"));//Footer
WApp.ActiveDocument.PageSetup.PageWidth = wapp.centimeterstopoints (float. Parse ("21"))//paper width
WApp.ActiveDocument.PageSetup.PageHeight = wapp.centimeterstopoints (float. Parse ("29.7"))//paper Height
WApp.ActiveDocument.PageSetup.FirstPageTray = microsoft.office.interop.word.wdpapertray.wdprinterdefaultbin;// Paper Source
WApp.ActiveDocument.PageSetup.OtherPagesTray = microsoft.office.interop.word.wdpapertray.wdprinterdefaultbin;// Paper Source
WApp.ActiveDocument.PageSetup.SectionStart = microsoft.office.interop.word.wdsectionstart.wdsectionnewpage;// Start of section: New page
WApp.ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter = 0;//Header Footer-odd-even page difference
WApp.ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = 0;//Header Footer-Home different
WApp.ActiveDocument.PageSetup.VerticalAlignment = microsoft.office.interop.word.wdverticalalignment.wdalignverticaltop;//Page Vertical Alignment
WApp.ActiveDocument.PageSetup.SuppressEndnotes =0;//do not hide endnotes
WApp.ActiveDocument.PageSetup.MirrorMargins = 0;//does not set the home page inside and outside margins
WApp.ActiveDocument.PageSetup.TwoPagesOnOne = false;//non-duplex printing
WApp.ActiveDocument.PageSetup.BookFoldPrinting =false;//do not set manual double-sided front Print
WApp.ActiveDocument.PageSetup.BookFoldRevPrinting =false;//do not set manual double-sided back print
WApp.ActiveDocument.PageSetup.BookFoldPrintingSheets = 1;//Print default number of copies
WApp.ActiveDocument.PageSetup.GutterPos = microsoft.office.interop.word.wdgutterstyle.wdgutterposleft;//Gutter is on the left
WApp.ActiveDocument.PageSetup.LinesPage = 40;//Default page row number
WApp.ActiveDocument.PageSetup.LayoutMode = microsoft.office.interop.word.wdlayoutmode.wdlayoutmodelinegrid;// Layout mode is "Specify row grid only"