About Autoopen in Macro

P

P&L-EC

I want the macro auto run when the Visio file open, I wrote a Macro called
"AutoOpen()", it worked in Word and Excel, but it do not work in Visio.

Is there any other method to make the macro auto run when open the visio
file ?

Thanks.
 
J

John

Dear P&L,

You need to place your code in an document open event in the "ThisDocument"
module:

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
'Your code here
End Sub

Best regards

John
 
P

P&L-EC

Dear John,

It is work

Thanks.

John said:
Dear P&L,

You need to place your code in an document open event in the "ThisDocument"
module:

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
'Your code here
End Sub

Best regards

John
 
J

John Marshall, MVP

Visio does not support Auto* macros as are available in Word and Excel.
Visio was not created by Microsoft but by Shapeware (later renamed Visio),
so even though there are some similarities, there are differences.

Visio was "acquired" by Microsoft after the release of Visio 2000.

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top