Page Orientation?

G

Gerard Braad

I want to change the page orientation to Landscape... but for some
reason i cant get it to work?!?!?


visio.Shapes visioShapes = visioPage.Shapes;
visio.Shape visioShape = visioShapes["ThePage"];

visio.Cell visioCell =
visioShape.get_CellsSRC((short)visio.VisSectionIndices.visSectionObject,
(short)visio.VisRowIndices.visRowDoc,
(short)visio.VisCellIndices.visPrintPropertiesPageOrientation);

// visPPOLandscape
//visioCell.set_ResultFromInt("PrintPageOrientation", 2);
//visioCell.FormulaU = "2";

// 32 = visNumber, 252 = visNoCast
//visioCell.set_ResultFromInt(32, 2);

//Console.WriteLine(visioCell.get_Result(32));
//visioCell.set_ResultFromInt(252, 2);
visioCell.set_ResultFromIntForce(252, 2);
Console.WriteLine(visioCell.Name + " " + visioCell.Shape.Name + " " +
visioCell.get_Result(252));


this results in: Sect1.02 ThePage 1

does anyone know how to change it??? the comments also suggest the other
things i tried. someow i do completely wrong :-S.

thanks in advance
 
G

Gary

This is how I do it.

Dim objDoc as Visio.Document
Dim objPages as Visio.Pages
Dim objPage as Visio.Page

Set objDoc = ThisDocument
Set objPages = objDoc.Pages
Set objPage = objPages.Item(1)

objDoc.PrintLandscape = True


'If using 8.5 x 11 then:

objPage.PageSheet.Cells("PageWidth") = 11
objPage.PageSheet.Cells("PageHeight") = 8.5

Hope this helps

Gary
 
G

Gerard Braad

This is what i eventually did.

visio.Cell visioCell = visioPage.PageSheet.get_CellsU("PageWidth");
visioCell.Formula = "297mm";
visioCell = visioPage.PageSheet.get_CellsU("PageHeight");
visioCell.Formula = "210mm";

thanks for your help :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top