AUTO OPEN macro

K

KKAlll

Is there a VISIO [Pro 2003 SP1 11.4301.6360] equivalent of Excel's auto open
marco?
Can you create a VISIO macro that automatically executes whenever the file
is opened?
Excel's "Sub AUTO_OPEN()" method of doing this apparently does not work in
VISIO.
 
K

KKAlll

Thanks, found the help covering "document open events".
Was written re WORD documents but also applied in general to VISIO.
The key was "Sub Document_DocumentOpened(ByVal doc As IVDocument)"
The following works whenever the file containing it in the "ThisDocument()"
object is opened!

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
MsgBox "Document_DocumentOpened worked!"
End Sub

Al Edlund said:
that would depend on what you mean by "whenever the file is opened?". If
your are asking for it generically, AFAIK the answer is no. If you are
asking relative to a specific drawing yes. It isn't quite as simple as the
basic office products and would require writing a little code to handle
events. I'd start over here

http://msdn.microsoft.com/library/en-us/devref/HTML/DVS_01_Introduction__544.asp?frame=true

and track down document opened events.

Al

KKAlll said:
Is there a VISIO [Pro 2003 SP1 11.4301.6360] equivalent of Excel's auto
open
marco?
Can you create a VISIO macro that automatically executes whenever the file
is opened?
Excel's "Sub AUTO_OPEN()" method of doing this apparently does not work in
VISIO.
 
Top