Running macro from template, not the document

C

camilla

I have a templated with a form in which open when I create
a new document, then it has a OK button and the form will
be hiding. I also has a macro assigned to the menu which
will show the form again but when I create a new document
based on the template, press the OK button and then want
to show the form again, it initialize the form again.
If I look att the macro I can run in the new document, I
can run 2 different macros from both Template and project
but when I create the menu in template I can only choose
of cause, the one from the template. Hope anyone
understand my problem.
 
W

Word Heretic

G'day "camilla" <[email protected]>,

make sure the scope for your object that holds the form is wide enough
to not get destroyed after procedure end.


Eg

Public MyForm as frmMyForm

Public Sub ShowForm()
if myform is nothing then set myform=new frmMyForm
MyForm.Show
End Sub


and then ensure the Terminate event of the form does an Unload Me



camilla said:
I have a templated with a form in which open when I create
a new document, then it has a OK button and the form will
be hiding. I also has a macro assigned to the menu which
will show the form again but when I create a new document
based on the template, press the OK button and then want
to show the form again, it initialize the form again.
If I look att the macro I can run in the new document, I
can run 2 different macros from both Template and project
but when I create the menu in template I can only choose
of cause, the one from the template. Hope anyone
understand my problem.

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

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