Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Including VBA when saving from .dot

4 views
Skip to first unread message

SoCalDave

unread,
Jan 6, 2010, 1:27:54 PM1/6/10
to

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

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

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


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

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

Doug Robbins - Word MVP

unread,
Jan 6, 2010, 4:22:19 PM1/6/10
to

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" <SoCalDav...@thecodecage.com> wrote in message
news:SoCalDav...@thecodecage.com...

SoCalDave

unread,
Jan 6, 2010, 8:13:43 PM1/6/10
to

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

> > 'Including VBA when saving from .dot - The Code Cage Forums'
> (http://www.thecodecage.com/forumz/showthread.php?t=167518)
> >
> > 'Microsoft Office Help' (&quot;http://www.thecodecage.com&quot;)

Doug Robbins - Word MVP

unread,
Jan 6, 2010, 8:51:35 PM1/6/10
to
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

0 new messages