Skip to main content

SetPageOrientation

Sets the page orientation.

Syntax

expression.SetPageOrientation(sPageOrientation);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sPageOrientationRequiredPageOrientationThe page orientation type.

Returns

This method doesn't return any data.

Example

This example sets the page orientation.

// How to change a page orientation.

// Set a page orientation and display it in the sheet.

let worksheet = Api.GetActiveSheet();
worksheet.SetPageOrientation("xlPortrait");
let pageOrientation = worksheet.GetPageOrientation();
worksheet.GetRange("A1").SetValue("Page orientation: ");
worksheet.GetRange("C1").SetValue(pageOrientation);