NativeExcel for .Net Developer's Reference

IPageSetup.CenterHorizontally Property

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

[Visual Basic]
Property CenterHorizontally As Boolean
[C#]
bool CenterHorizontally { get; set; }
[C++]
__property bool get_CenterHorizontally();
__property void set_CenterHorizontally(bool );
[JScript]
function get CenterHorizontally() : bool
function set CenterHorizontally(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;
[Visual Basic]
book.Worksheets(1).PageSetup.CenterHorizontally = True
[C++]
book->Worksheets->Item[1]->PageSetup->CenterHorizontally = true;

See Also

IPageSetup Interface | NativeExcel Namespace | CenterVertically | PageSetup Property