• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1597
  • Last Modified:

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?
0
brothertruffle880
Asked:
brothertruffle880
1 Solution
 
Scott HelmersVisio 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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now