Create Templates on the fly?

J

JB

Hi Folks,

I'm looking for a way to create templates on the fly with a preset styleset
and custom toolbars. This is so that if my users do not have/have
lost/deleted their original templates provided by me then the templates will
be recreated by a wizard. I want to use this so that users are only using
these templates for a specified period of time to reduce the risk of
template corruption and give me more control over the templates (I much
prefer using code to create documents).

Can this be done and if so where is a good place to start or find info on
this?

Cheers

J
 
J

Jezebel

It's actually a kind of circular issue. There's no particular difficulty
creating a template on the fly from VBA code. You can even add VBA code on
the fly. Problem is, the code that does it has to be in an installed
template or add-in to start with. The object containing that code is just as
likely to get lost or corrupted as the templates you're re-creating.

Is template loss or corruption a serious issue? (If I delete a template, I
damn well expect it to stay deleted!)

But anyway, create an add-in with code that runs when Word starts, to check
the configuration and templates, and rebuild as necessary. Manipulating
toolbars from code is tricky, but doable. Be very careful with the
CustomizationContext setting (which determines where toolbar changes are
saved) -- misuse of this setting is the only event I've met that DOES
consistently cause template corruption.
 
J

JB

Thanks Jezabel,

Do you know of any resources that I can use for reference as I'm kinda new
at this VBA stuff

cheers
J
 

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