using System; using System.Drawing; using Docs.Word; namespace SampleManager { class Sections_PageSetup { internal static Document Main1() { // Open the document with given name Document Doc = Document.ReadDOC(Form1.SourceFolder + "Sections - PageSetup.doc"); PageSettings PS = Doc.Sections[0].Style.PageSettings; // Change the page properties PS.PageHeight = 500; PS.PageWidth = 400; PS.Margins.Top = 25; PS.Margins.Left = 40; // Create the page borders with given parameters PS.Borders = new Borders(1, BorderStyle.Dashed, Color.Red, 10); return Doc; } } }