VISIO Page Setup

C

CADGuy

OK, I have a VB code which opens a VISIO file, goes to a tab called "notes1" and then sets the Print Page Setup to Landscape. However, when I execute this code, it does not change the page setup, ev3en though it runs through the tabs.

Dim stnObj As Visio.Document
Dim visSectionObject As Long
Dim visRowPrintProperties As Long
Dim visPrintPropertiesPageOrientation As Integer


appVisio = CreateObject("visio.application")
docsObj = appVisio.Documents

'opens the Basic Shapes stencil.
docObj = docsObj.Open("C:\Documents and Settings\kbranin\Desktop\New Folder\Boyle - (90)(E) - 238 La Grange.vsd")

stnObj = appVisio.Documents("C:\Documents and Settings\kbranin\Desktop\New Folder\Phase C Elec stencil.vss")
pagsObj = appVisio.ActiveDocument.Pages

appVisio.ActiveWindow.Page = appVisio.ActiveDocument.Pages.ItemU("Notes1")
appVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPageOrientation).Formula = "=2"

appVisio.ActiveWindow.Page = appVisio.ActiveDocument.Pages.ItemU("Notes2")

appVisio.ActivePage.Background = False
appVisio.ActivePage.BackPage = ""
appVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPageOrientation).FormulaForce = "=2"

appVisio.ActiveWindow.Page = appVisio.ActiveDocument.Pages.ItemU("Notes3")

appVisio.ActivePage.Background = False
appVisio.ActivePage.BackPage = ""
appVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPageOrientation).FormulaForce = "=2"

MsgBox("Drawing finished!", , "Hello World!")
appVisio.Quit()
End Sub

Any input will be GREATLY appreciated.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Get over $700 in E-learning Visual Studio.NET 2005 Courses Free till 11/17!
http://www.eggheadcafe.com/tutorial...46d-c03bb3ef7da7/get-over-700-in-elearni.aspx
 
K

Kevin B

That is already set. The page appears to be in Landscape. However, in order to print in landscape, you need to go to page setup, choose landscape for all three note sheets, and then print. If I save the file with the notes set to landscape and reopen, they revert to portrait. We have some pages that need to be in Portrait and others that need to be in landscape all in the same vsd file.

So, I am devising a VB workaround to open the file, set the notes to landscape, and then print for multiple drawing files.



AlEdlund wrote:

since you are already into the page sheet you might consider setting
15-Dec-09

since you are already into the page sheet you might consider setting the
pagewidth to 11 and the pageheight to 8.5.
al

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Run the command or application in the Security context of specified user
http://www.eggheadcafe.com/tutorial...c-17c9e7073bfd/run-the-command-or-applic.aspx
 

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

Top