NativeExcel2 for .Net Developer's Reference

IPageSetup.TopMargin Property

Gets or sets the size of the top margin, in inches.

[Visual Basic]
PropertyTopMarginAsDouble
[C#]
doubleTopMargin{get;set;}
[C++]
__propertydoubleget_TopMargin();
__propertyvoidset_TopMargin(double);
[JScript]
functiongetTopMargin():double
functionsetTopMargin(double);

Property Value

Double. Size of the top margin, in inches.

Example

This example set the top margin of sheet one to 1/2 inches.

[C#]
book.Worksheets[1].PageSetup.TopMargin = 0.5;
[VisualBasic]
book.Worksheets(1).PageSetup.TopMargin = 0.5
[C++]
book->Worksheets->Item[1]->PageSetup->TopMargin = 0.5;

See Also

IPageSetup Interface | NativeExcel Namespace | HeaderMargin | FooterMargin | BottomMargin | LeftMargin | RightMargin | PageSetup Property