Solved

Visio VBA 2013 -  AUTO OPEN MACRO?

Posted on 2014-01-24
2
1,337 Views
Last Modified: 2014-01-27
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
Comment
Question by:brothertruffle880
2 Comments
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 500 total points
ID: 39807280
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
 

Author Closing Comment

by:brothertruffle880
ID: 39812061
Excellent.   Works perfectly.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Periodically someone asks me whether there’s a way to automatically convert all of the pages in a Visio drawing to PowerPoint slides. There have even been a few times when I’ve wanted to do that myself but I never really had enough incentive to figu…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now