What event should be used to pop a form from an existing document

R

Rajesh.N

Hi,

I have an template file (dotm), I have an VB form attached to this template.
I have added a code form1.show to Document_New() and Document_Open() events.
When I create an new file based on this template, the form1 pops up as the
document_new() event would be triggered !
But I want this form1 to be poped up when I open an saved document that was
created based on this template...

How can I get this done?

Thanks in advance

Regards,
Rajesh.N
 
T

Tony Jollans

From your description, it should happen from the document_open in the
template. If it doesn't then it is most likely that the template is not
available when you are opening the document based on it, and so Word is
using Normal instead.
 
G

Gordon Bentley-Mix

Rajesh,

As far as I've been able to ascertain, any code written against the
Document_Open event in a template should execute whenever a document based on
that template is opened - provided that the document is still attached to the
template and that the user has access to the template. I'd suggest inserting
a breakpoint into your Document_Open code and stepping the code to ensure
that it's actually executing as intended.

Another good indicator that the code is executing correctly would be that it
runs when the template itself is opened. If the UserForm isn't displayed on
opening the template, then there's something wrong.
-----
Cheers!

Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 

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