NativeExcel for .Net Developer's Reference

IPageSetup.TopMargin Property

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

[Visual Basic]
Property TopMargin As Double
[C#]
double TopMargin { get; set; }
[C++]
__property double get_TopMargin();
__property void set_TopMargin(double );
[JScript]
function get TopMargin() : double
function set TopMargin(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;
[Visual Basic]
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