Default paper size in Visio

Started by ziko, December 23, 2010, 09:45:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ziko

Hi
I am trying to force a particular page size, drawing scaling... using the following code:
The problem is that sometimes it changes especially when copying and pasting from a standalone opened document into the one opened from the Add-in.
Am I missing anything to keep these parameters always the same?
Thank you
Ziko


        mVisioApp.Documents(1).PaperSize = visPaperSizeA4
        Set lPageCell = mVisioApp.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageWidth)
        lPageCell.Result(visInches) = 240

        Set lPageCell = mVisioApp.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageHeight)
        lPageCell.Result(visInches) = 144

        Set lPageCell = mVisioApp.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageScale)
        lPageCell.Result(visInches) = 0.25

        Set lPageCell = mVisioApp.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageDrawingScale)
        lPageCell.Result(visInches) = 12

        Set lPageCell = mVisioApp.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageDrawSizeType)
        lPageCell.Result(visInches) = visPrintSetup

aledlund

The only document being set up for a page size is the first document. From then on you're setting up the active page (which may - or may not, be in the first document).
al

JuneTheSecond

You mentioned "it changes especially when copying and pasting from ..."
Are you working on Visio 2010?
If so, you need to set DrawingResizeType cell on Page to 2, but not to default 1.
Best Regards,

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