How to load a window when a template is used

J

Jon Albright

How can do I load my window when the user creates a
document from my template? I want to do something similar
to the "Database Properties" anchor window that is used
in the "Database Model Diagram" template that comes with
Visio 2002. I've figured out how to create the window and
all that, I just need to know the exact time to load the
window. The Database Model Diagram template seems to be
able to do it without adding any vba added to the
Document_DocumentCreated event or anything like that. I'd
like to do the same. Any ideas? Thanks!
~Jon
 
B

Bill K. [MSFT]

You can add a persistent event to your template that will run your add-on
when the template is opened.

For example, to create a template that runs the org chart wizard, open a new
blank document and execute the following two lines in the VBA immediate
window:
ActiveDocument.EventList.Add visEvtCodeDocOpen, visActCodeRunAddon,
"orgcwiz", ""
ActiveDocument.EventList.Add visEvtCodeDocCreate, visActCodeRunAddon,
"orgcwiz", ""
Then save-as vst.

You can also use the "Persistent Events Tool" that is provided with the
Visio SDK. It is available here:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/visio.asp


Hope this helps,
 

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