Making userforms accessible to multiple templates

E

EllenM

Hello

I have a userform under my Normal.dot file which I want to be accessible by
4 other user-defined templates. I envision adding a toobar to each template
which contains a button that links you to the global userform from any
document created from any of the user-defined templates. Is there a way that
this can be done?

Thanks!
Ellen
 
S

Shauna Kelly

Hi Ellen

Yes, this can be done. Here is one way:

First, create a new .dot file and move the form and any associated code
out of your normal.dot into this new .dot file. Let's say it's called
"FileA.dot". I suggest that, at this point, you re-name your normal.dot
file to (eg) normal.dot.old and move it out of the User Templates folder
so it does not get in the way of your work.

Second, in your new .dot file (FileA.dot) create a procedure that opens
the form. Let's say this procedure is called "ShowMyForm".

Third, in each of your templates, create a procedure that calls
FileA.ShowMyForm. And, in each template, create a toolbar with a button
that calls the procedure that is in that template.

Finally, put FileA.dot in your Word Startup folder, so Word will load it
whenever you start Word and thus make it available to your templates.

To deploy this, FileA.dot will need to go in users' Word Startup folder,
and the templates in one of the usual template locations.

Post back if you need more details and let us know where you're up to in
the process and what version of Word you're using.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
E

EllenM

Thanks so much, Shauna.

Shauna Kelly said:
Hi Ellen

Yes, this can be done. Here is one way:

First, create a new .dot file and move the form and any associated code
out of your normal.dot into this new .dot file. Let's say it's called
"FileA.dot". I suggest that, at this point, you re-name your normal.dot
file to (eg) normal.dot.old and move it out of the User Templates folder
so it does not get in the way of your work.

Second, in your new .dot file (FileA.dot) create a procedure that opens
the form. Let's say this procedure is called "ShowMyForm".

Third, in each of your templates, create a procedure that calls
FileA.ShowMyForm. And, in each template, create a toolbar with a button
that calls the procedure that is in that template.

Finally, put FileA.dot in your Word Startup folder, so Word will load it
whenever you start Word and thus make it available to your templates.

To deploy this, FileA.dot will need to go in users' Word Startup folder,
and the templates in one of the usual template locations.

Post back if you need more details and let us know where you're up to in
the process and what version of Word you're using.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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