Print Page Orientation & Drawing Size Type

R

Rad

Hi,

I run the below script, and it supposed to set the page setup to LANDSCAPE.
But after (oVISIO.ActivePage.PageSheet.Cells("PrintPageOrientation") = 2)
run, the DrawingSizeType is set to 2. Therefore, the Landscape seting will
not work.

Any Ideas?

Thanks,
Rad


'Set the variable (runs new instance of VISIO).
Set oVISIO = CreateObject("visio.Application")
set newdoc1 = oVISIO.Documents.add("")

'Or Any
newdoc1.Application.Documents.OpenEx "RS-Visio-Script.vss", visOpenRO +
visOpenDocked
newdoc1.Application.Windows.ItemEx("Drawing1.vsd").Activate
'Trying to Set the Page Setup
oVISIO.ActivePage.PageSheet.Cells("PrintPageOrientation") = 2
oVISIO.ActivePage.PageSheet.Cells("DrawingSizeType") = "0"
 
J

JuneTheSecond

Would you try next one?
Sub test()
Dim oVISIO As Visio.Application
Dim newdoc1 As Visio.Document
'Set the variable (runs new instance of VISIO).
Set oVISIO = CreateObject("visio.Application")
Set newdoc1 = oVISIO.Documents.Add("")

'Trying to Set the Page Setup
Dim dummy As String
With oVISIO.ActivePage.PageSheet
.Cells("DrawingSizeType") = "0"
.Cells("PrintPageOrientation") = 2
dummy = .Cells("PageWidth").Formula
.Cells("PageWidth").Formula = .Cells("PageHeight").Formula
.Cells("PageHeight").Formula = dummy
End With
End Sub
 

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