跳到主要内容

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.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetPageOrientation("xlPortrait");
var sPageOrientation = oWorksheet.GetPageOrientation();
oWorksheet.GetRange("A1").SetValue("Page orientation: ");
oWorksheet.GetRange("C1").SetValue(sPageOrientation);