NativeExcel for .Net Developer's Reference

IPageSetup.CenterVertically Property

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

[Visual Basic]
Property CenterVertically As Boolean
[C#]
bool CenterVertically { get; set; }
[C++]
__property bool get_CenterVertically();
__property void set_CenterVertically(bool );
[JScript]
function get CenterVertically() : bool
function set CenterVertically(bool);

Property Value

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

Example

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

[C#]
book.Worksheets[1].PageSetup.CenterVertically = true;
[Visual Basic]
book.Worksheets(1).PageSetup.CenterVertically = True
[C++]
book->Worksheets->Item[1]->PageSetup->CenterVertically = true;

See Also

IPageSetup Interface | NativeExcel Namespace | CenterHorizontally | PageSetup Property