Visio VBA 2013 - AUTO OPEN MACRO?

I need a macro that runs when FILE XXXX is opened.  I need the Visio file to open on the first page of the file and have that page "fit to window"
Can someone help me?
brothertruffle880Asked:
Who is Participating?
 
Scott HelmersConnect With a Mentor Visio Consultant, Trainer, Author, and DeveloperCommented:
Place this code into the ThisDocument module
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)

    ActiveWindow.Page = doc.Pages(1)        ' move to page 1
    
    ActiveWindow.Zoom = -1                  ' set zoom to whole page

End Sub

Open in new window

0
 
brothertruffle880Author Commented:
Excellent.   Works perfectly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.