Darryn Jacobs
Darryn Jacobs

Reputation: 188

Making a Visio document page landscape c#

I am new to developing Visio documents using C# and I was wondering if there is any method or formula that would set the current document to display landscape?

I have found Document.PrintLandscape = true, but it is not what I am looking for.

Upvotes: 0

Views: 724

Answers (1)

Nikolay
Nikolay

Reputation: 12245

In Visio, you just set page size to change orientation. Like this (letter size):

var pageSheet = Application.ActivePage.PageSheet;

// set landsape
pageSheet.Cells["PageWidth"].FormulaU = "11 in";
pageSheet.Cells["PageHeight"].FormulaU = "8.5 in";
pageSheet.Cells["PrintPageOrientation"].FormulaU = "2";

// set portrait
pageSheet.Cells["PageWidth"].FormulaU = "8.5 in"
pageSheet.Cells["PageHeight"].FormulaU = "11 in"
pageSheet.Cells["PrintPageOrientation"].FormulaU = "1"

Upvotes: 1

Related Questions