Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New pages in a Visio document

Status
Not open for further replies.

neilkeron

Technical User
Sep 22, 2003
3
GB
I have a Visio document with several A4 pages. I am using VBA to insert a new page which I want to be A3. I am using the Add method and am using an A3 background for the new drawing but is still opens as A4. Is there a way to do a Page Setup from VBA?
 
Try:
Public Sub PageSize()

' This routine will change the paper size
Debug.Print ActivePage.Shapes("thePage").Cells("PageWidth")
Debug.Print ActivePage.Shapes("thePage").Cells("PageHeight")

ActivePage.Shapes("thePage").Cells("PageWidth").Formula = 7.5
ActivePage.Shapes("thePage").Cells("PageHeight").Formula = 15

Debug.Print ActivePage.Shapes("thePage").Cells("PageWidth")
Debug.Print ActivePage.Shapes("thePage").Cells("PageHeight")

ActivePage.Shapes("thePage").Cells("PageWidth").Formula = 8.5
ActivePage.Shapes("thePage").Cells("PageHeight").Formula = 11

Debug.Print ActivePage.Shapes("thePage").Cells("PageWidth")
Debug.Print ActivePage.Shapes("thePage").Cells("PageHeight")

End Sub

John... Visio MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top