Get Started
Usage API

SetPageOrientation

SetPageOrientation(sPageOrientation)

Set page orientation

Parameters:

Name Type Description
sPageOrientation PageOrientation

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.SetPageOrientation("xlPortrait");
oPageOrientation = oWorksheet.GetPageOrientation();
oWorksheet.GetRange("A1").SetValue("Page orientation: ");
oWorksheet.GetRange("C1").SetValue(oPageOrientation);
builder.SaveFile("xlsx", "SetPageOrientation.xlsx");
builder.CloseFile();

Resulting document