brothertruffle880
asked on
Visio 2013 - executing VBA code after landing in a page
I have a 30 page Visio file and each time I navigate to a page 1, 3, 7, etc. I would like that page to change its view into FIT TO WINDOW.
How can I get this done?
How can I get this done?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Haha!
ASKER
Scot:
Where do I place the code?
I put it in THIS DOCUMENT and nothing happened.
I put it in MODULE1 and the DIM statement appeared in Red.
Where do I place the code?
I put it in THIS DOCUMENT and nothing happened.
I put it in MODULE1 and the DIM statement appeared in Red.
Dim WithEvents Win1 As Visio.Window
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Set Win1 = ActiveWindow
End Sub
Private Sub Win1_WindowTurnedToPage(ByVal Window As IVWindow)
Win1.Zoom = -1
End Sub
Place the code in ThisDocument. Close the document and then open it again -- that will execute Document_DocumentOpened, which activates the ability to trap the turned-to-page event.
At this point, the code will be running but it won't look like it's doing anything unless you have pages that are zoomed in or out. So -- zoom way in or out on a page, change to another page and then change back to the first page -- it will be back to full page view.
At this point, the code will be running but it won't look like it's doing anything unless you have pages that are zoomed in or out. So -- zoom way in or out on a page, change to another page and then change back to the first page -- it will be back to full page view.
ASKER
Put code in ThisDocument
The attached file includes the code pasted from above.
Zoom-to-full-page-on-page-turn.vsd
Zoom-to-full-page-on-page-turn.vsd
ASKER
In a stupid design decision, EE only allows one BEST solution --which in this case is profoundly unjust.