Apply Multiple Templates? What's the right approach?

K

kiln

I am generating word 2002 docs based on a custome template that includes
a customized toolbar that runs VBA routines. Using bookmarks I've pre-
populated a lot of basic info in the doc. I then need to pass off these
generated docs to someone that fills in the balance of the document
info. That person has a set of 50 templates that she has been using to
fill in sections of the starting doc based on certain criteria. I'm
pretty unfamiliar with Word templates and what I am running up against,
surprisingly, is that if she applies one of her custom dot files to what
I pass her, her access to the custom toolbar in my original dot is lost.

I'm not sure how to deal with this. As far as I can tell, a word doc can
only be attached to one dot at a time. This would seem to imply that I'd
have to add my VBA code and toolbar to all of her 50 specail dot files
for her to retain access to the them. I could do this but the maint
seems onerous.

Is there an alternate approach? For instance, another way that the
second stage text mods could be implemented besides using the 50 custom
dot files?
 
C

Chad DeMeyer

kiln,

I'm not sure I understand what she is doing. In what way is she using
various templates to fill in sections of the document?

In any case, you should have her store your template in her Word startup
location - she can determine what that location is using Tools>Options>File
Locations>Startup. Have her copy the template to that folder, then restart
Word. The template is now loaded as a global add-in when Word starts, which
means that just like Normal.dot, its macros and toolbar/keyboard
customizations are always accessible in every document.

Regards,
Chad
 
K

kiln

Thanks

The second stage person has been starting new docs from any of 50
templates. They contain different version of boilerplate and it saves a
lot of cut and paste. At the time that I generate the doc in the first
step, it's not clear which of the 50 templates might apply.

I don't want the custom toolbar to be available for all word docs, so
I'm not sure placing it in the global pool would be appropriate.
 
C

Chad DeMeyer

kiln,

If you don't want the custom toolbar to be available for all Word docs, you
could show her how to manually load it as an add-in using Tools>Templates
and Add-Ins, then unload it through the same dialog when she is finished
with the toolbar. Alternatively, she could just leave it as a global but
only display the toolbar when she needs it.

It's not clear whether the 50 templates serve any other purpose than
providing boilerplate text for this operation, but even if they do, for this
I would suggest having one template with 50 autotext entries. She can
attach the document to the template, again with Tools>Templates and Add-Ins.
Then she has access to all the autotext entries.

Regards,
Chad
 
K

kiln

Hi Chad

The autotext option might work. This lady is pretty set in her ways and
I'm trying to have as little impact on her preferences as I can. Not
sure how she'd take to the autotext option. However, I see the point -
she is only after text and autotext might be a better way to apply it.

An alternate might be if I could have her click on a button on a toolbar
and pick from a userform listbox an entry that would insert, at the
approprate place, the content of one of her templates. That would allow
her to maintain her dot files in the way she is used to. What area of
word vba would I look at in order to evaulate the difficulty of
inserting the text, the userform and listbox I am familiar with.

Thanks
 
C

Chad DeMeyer

kiln,

Inserting the text would be the easy part. Much more problematic would be
how to get it from 50 different sources. I still think autotext is the way
to go, but you could still build a custom interface for inserting those
particular autotext entries, to help sell it to the end user. Then you
could just give the Autotext entries meaningful names that you could use as
the list items in your listbox, so to insert them use something like:

Set oAT = ActiveDocument.Attached Template

oAT.AutoTextEntries(lbxEntries.Value).Insert Range:=Selection.Range,
RichText:=True

Regards,
Chad
 
K

kiln

Thanks Chad you've been very helpful.

"Chad DeMeyer" said:
kiln,

Inserting the text would be the easy part. Much more problematic would be
how to get it from 50 different sources. I still think autotext is the way
to go, but you could still build a custom interface for inserting those
particular autotext entries, to help sell it to the end user. Then you
could just give the Autotext entries meaningful names that you could use as
the list items in your listbox, so to insert them use something like:

Set oAT = ActiveDocument.Attached Template

oAT.AutoTextEntries(lbxEntries.Value).Insert Range:=Selection.Range,
RichText:=True

Regards,
Chad
 

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