NativeExcel for .Net Developer's Reference

IPageSetup.Orientation Property

Portrait or landscape printing mode.

[Visual Basic]
Property Orientation As XlPageOrientation
[C#]
XlPageOrientation Orientation { get; set; }
[C++]
__property XlPageOrientation get_Orientation();
__property void set_Orientation(XlPageOrientation );
[JScript]
function get Orientation() : XlPageOrientation
function set Orientation(XlPageOrientation);

Property Value

Orientation can be one of XlPageOrientation values.

Example

This example sets the first sheet to be printed in landscape orientation.

[C#]
book.Worksheets[1].PageSetup.Orientation = XlPageOrientation.xlLandscape;
[Visual Basic]
book.Worksheets(1).PageSetup.Orientation = XlPageOrientation.xlLandscape
[C++]
book->Worksheets->Item[1]->PageSetup->Orientation = XlPageOrientation::xlLandscape;

See Also

IPageSetup Interface | NativeExcel Namespace | XlPageOrientation Enumeration | PageSetup Property