Update Template Files - AddIns?

M

mark

Hi All,

I'm after some advice about the best way to setup some templates and have
them update.

What I would like to do is be able to update a series of template files
after the user has chosen a header (company logo we have more than one) and a
footer (office addresses we have about 10).

The story so far is that I have created a single template using AutoText and
user forms and I can get the template to add headers and footers ok. change
them etc. But it will prompt the user to choose each time they open a
document based on the template.

What I would like to happen is that once user has chosen logo and office
address, is for the template document to be updated so that they are not
prompted again when they open a new document. (Template files to be down
loaded to users PC's)

The thing is that there will be at least 6 or 7 template files and I would
prefer that the choice for headers and footers is only done once and that
they will update all templates regardless of which template they choose first.

I've read some posts and looked on the net for info on AddIns but not really
sure if this is the way to go, or how to set these up.

I know that this a long post and thanks for reading this far.

Any advice welcome
 
J

Jonathan West

The way you do this is prompt only the first time, and store the response in
the registry using the SaveSetting command

Then, each subsequrnt time a document is created, check the regsitry entry
using GetSetting, and use the Autotext entry whose name you have stored. You
can have a common entry for all your templates.

You might also want to provide an "Update details" function to allow the
user to change their details, for instance if they made a mistake first time
round

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
M

mark

Hi Jonathan,

Thanks for the response.

I'll try it out, I'll have to look up how you do this.
If you have any examples it would save a lot of time for me, if not watch
this space as I'm fairly new to VBA.

TIA

Mark
 
J

Jonathan West

mark said:
Hi Jonathan,

Thanks for the response.

I'll try it out, I'll have to look up how you do this.
If you have any examples it would save a lot of time for me, if not watch
this space as I'm fairly new to VBA.

There are code examples in thw Word VBA Help for GetSetting and SaveSetting.
If you have already got your code to the point where you can produce a
prompt asking which layout to use, you are already 90% of the way there.
Just have your code use GetSetting to retrieve the registry value if
present.

If it's not present, show the prompt and save the user choice.

If the registry value is present, use it to set the layout.

By all means post back here if you get stuck.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
C

Charles Kenyon

You might store the information you want in a local AutoText global and use
AutoText fields to insert that information. That way, the same template will
give different results for different users. This would require no vba in the
templates themselves.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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