[C#] [Visio 2010] How to set a page to landscape orientation

Started by sieppl, January 31, 2014, 06:05:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sieppl

Hi!

How can I set the current page (not for print, but design) to landscape in C#?
In other words how can I achieve the same like clicking on "Design" -> "Orientation" -> "Landscape" programmatically?

This seems to be wrong:


        private void SetLandscape(Visio.Page currentPage)
        {
            Visio.Shape sheet = currentPage.PageSheet;
            sheet.get_CellsSRC((short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowPrintProperties, (short)Visio.VisCellIndices.visPageWidth).FormulaU = "11 in";
            sheet.get_CellsSRC((short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowPrintProperties, (short)Visio.VisCellIndices.visPageHeight).FormulaU = "8.5 in";
            sheet.get_CellsSRC((short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowPrintProperties, (short)Visio.VisCellIndices.visPageDrawSizeType).FormulaU = "3";
        }


Thanks for any help!

JuneTheSecond

I am not sure, but visRowPrintProperties may be visRowPage.
The second parameters in CellsSRC functions.
Best Regards,

Junichi Yoda
http://june.minibird.jp/