跳到主要内容

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.

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