Solved

Visio 2013 - VBA - Open File procedure

Posted on 2014-04-01
2
476 Views
Last Modified: 2014-04-01
I would like to run the procedure below (with a few additional lines of enhancements).  
- Is there any way I can generate a message to appear saying "Please wait" as soon as the file is opened so that the user doesn't start typing away as soon as they see a glimmer of their diagram.  
- Is there any way I can block keyboard entry until after the procedure below is run?  Perhaps blank out the screen with the "Please wait" message?

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)

    Set Win1 = ActiveWindow

    ActiveWindow.Page = doc.Pages(1)        ' move to page 1
    
    ActiveWindow.Zoom = -1                  ' set zoom to whole page
    
   '  more code to be input here
   '  more code to be input here

    MsgBox "You are ready to work." 


End Sub

Open in new window

0
Comment
Question by:brothertruffle880
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39969180
Hi,
pls try
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Application.ShowChanges = False

    Set Win1 = ActiveWindow

    ActiveWindow.Page = doc.Pages(1)        ' move to page 1
    
    ActiveWindow.Zoom = -1                  ' set zoom to whole page
    
   '  more code to be input here
   '  more code to be input here

Application.ShowChanges = True
    MsgBox "You are ready to work." 


End Sub

Open in new window

Regards
0
 

Author Comment

by:brothertruffle880
ID: 39969396
Thanks Rgonzo!
Perfect.
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent Visio zone question asked how to use the data in an Excel file to create a Visio Gantt chart -- and then to dynamically update the Gantt chart. The good news is that the Viso Gantt Chart wizard can be automated. The bad news is that the…
Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

696 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