NativeExcel for .Net Developer's Reference

IPageSetup.Orientation Property

Portrait or landscape printing mode.

[Visual Basic]
PropertyOrientationAsXlPageOrientation
[C#]
XlPageOrientationOrientation{get;set;}
[C++]
__propertyXlPageOrientationget_Orientation();
__propertyvoidset_Orientation(XlPageOrientation);
[JScript]
functiongetOrientation():XlPageOrientation
functionsetOrientation(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;
[VisualBasic]
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