Including VBA when saving from .dot

S

SoCalDave

Is it possible to save the VBA from a .dot with a document created fro
that template?

I have created a template that produces documents that rely on the vb
from the template. The template includes a userform that has multipl
fields (e.g. textbox, listbox, etc.). After completing and exiting thi
userform, the information that is unloaded is then re-loaded when th
user tabs through a form field in the document that runs a macro on exi
("runUF"). This and the bookmarks in the document related to th
userform mean that all documents created from this template will alway
rely on the template (the purpose of this relaod is asthetics and eas
of use)

Because this document is being used on a large and long term scale
would like to save the vba with each newly created documment. Is thi
possible? If so how? The concern is that the template will have to b
moved in the future, therefore loosing the reference to the templat
(.dot
 
D

Doug Robbins - Word MVP

You probably should put the code in an Add-in (a template that is stored in
the Word Startup folder). It would then be available to any document that
contained a formfield with the runUF macro set to be run on exit from a
formfield.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
S

SoCalDave

Would this add-in be available to any user that accessed the document
We have users in several other buildings that create documents based o
these templates. The templates are currently stored on a company share
drive. I want to be able to move the document around to different share
drives without loosing the vba necessary to run the macro.

Thanks
 
D

Doug Robbins - Word MVP

Yes, if the add-in was installed on their computers.

See the article "Distributing macros to other users" at:
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

SoCalDave said:
Would this add-in be available to any user that accessed the document?
We have users in several other buildings that create documents based on
these templates. The templates are currently stored on a company shared
drive. I want to be able to move the document around to different shared
drives without loosing the vba necessary to run the macro.

Thanks
You probably should put the code in an Add-in (a template that is stored
in
the Word Startup folder). It would then be available to any document
that
contained a formfield with the runUF macro set to be run on exit from
a
formfield.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my
services on
a paid professional basis.


--
SoCalDave
------------------------------------------------------------------------
SoCalDave's Profile: 1363
View this thread:
http://www.thecodecage.com/forumz/showthread.php?t=167518

Microsoft Office Help
 

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