Re: Dynamically adding vba modules to word application



It's theoretically possible, but Word will fight you all the way if
you try to do it. Code that adds or modifies code is classic virus
behavior, so you have to go to extreme lengths to work around the
security mechanisms.

Fortunately, it isn't necessary for your use case. Simply put your
code into a separate template, and have the client place that template
in their Startup folder (the location is shown in the Tools > Options
File Locations dialog). The template will be loaded as a global
template every time Word starts, and the code will be available in all
documents.

On Mon, 17 Dec 2007 18:07:38 -0800 (PST), samlotti@xxxxxxxxx wrote:

Hello,

Im trying to create a word document with a bootstrap vba module that
will insert modules dynamically at runtime. Is there a way to do
this?

The real use cae is that I have a large (1m) in vba template code that
I want to send to a client. But since its so large, Ide like o send
it one and store it locally, the each time they download one of our
documents it is basically a bootstrap that loads the real vba macro.



Thanks
Sam

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
.



Relevant Pages

  • Re: Transfert VBA macro to a document
    ... And then lock down the VBA Project. ... Asking our people to go under VBA to protect the code: ... Transfer Modules from a template to a Document ...
    (microsoft.public.word.vba.userforms)
  • Re: Transfert VBA macro to a document
    ... And then lock down the VBA Project. ... Asking our people to go under VBA to protect the code: ... Transfer Modules from a template to a Document ...
    (microsoft.public.word.vba.userforms)
  • Re: VBA code (Where does it live)
    ... that the search mechanism doesn't look in. ... If you open a template in a hex editor that can show the ASCII/Unicode ... I work with vba and templates and I am well aware of the VBA editor and what ...
    (microsoft.public.word.vba.general)
  • Re: Need to create a new template that enables users to select fro
    ... VBA for something like this wouldn't be too hard. ... Bill Foley, Microsoft MVP ... > Is there not any simpler way of having a generic template that would on ... > startup ask a question about the security classification ...
    (microsoft.public.word.vba.general)
  • Re: Newbie: Need advice on how to start creating a Meeting Minutes doc
    ... Larry Woods ... >> was that this Word document will be filled from VBA, ... >> the various areas of the template that I will use as my...well, ... >>> Anne Troy ...
    (microsoft.public.word.vba.beginners)

Loading