Section.Margins Property | Office File API | DevExpress Documentation Skip to main content

Section.Margins Property

Provides access to an object used to specify or retrieve a section’s margin settings.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v26.1.Core.dll

Declaration

SectionMargins Margins { get; }

Property Value

Example

The following code snippet changes the first section’s margins:

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.LoadDocument("Document.docx");

    Document document = wordProcessor.Document;

    Section firstSection = wordProcessor.Document.Sections[0];

    var pageMargins = firstSection.Margins;
    pageMargins.Left = Units.InchesToDocumentsF(0.5f);
    pageMargins.Top = Units.InchesToDocumentsF(0.7f);
    pageMargins.Right = Units.InchesToDocumentsF(0.5f);
    pageMargins.Bottom = Units.InchesToDocumentsF(1.5f);
}
See Also
Use of this site constitutes acceptance of our Website Terms of Use and Privacy Policy (Updated). Cookies Settings