NativeExcel2 for .Net Developer's Reference

IPageSetup.CenterHorizontally Property

Gets or sets a value that indicates whether the sheet is centered horizontally.

[Visual Basic]
PropertyCenterHorizontallyAsBoolean
[C#]
boolCenterHorizontally{get;set;}
[C++]
__propertyboolget_CenterHorizontally();
__propertyvoidset_CenterHorizontally(bool);
[JScript]
functiongetCenterHorizontally():bool
functionsetCenterHorizontally(bool);

Property Value

True if the sheet is centered horizontally on the page when it's printed.

Example

This example centers sheet one horizontally when it's printed.

[C#]
book.Worksheets[1].PageSetup.CenterHorizontally = true;
[VisualBasic]
book.Worksheets(1).PageSetup.CenterHorizontally = True
[C++]
book->Worksheets->Item[1]->PageSetup->CenterHorizontally = true;

See Also

IPageSetup Interface | NativeExcel Namespace | CenterVertically | PageSetup Property