Updating Word Templates

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I'm a software developer and use Access extensively. My knowledge of
VBA is pretty good. so when I was approached to undertake a project to
modify some Word (2003) templates, which included forms and VBA code, I
felt it would be no problem.

My problem is how to save these templates. Afer opning the .dot file,
modifying some VBA code, and also making changes within the document
(Bookmarks, fonts, etc.) it seems impossible to savethis .dot file and
retain all the changes. If I do a file/save from within the VBA code,
it saves all the code changes, but none of the formatting changes in
the document. On the other hand, if I do a file/save from the document,
it will save all the document formatting changes but all the code and
forms are gone. I've checked off to "automatically update document
styles and also tried Save All by holding down the shift key

I"m at a loss now what else to try

Any suggestions???
 
Hi Richard

Let's see if we've got this right:

- you have a template (the .dot) file
- you used File > New, chose your template and Word created a new document
(.doc file) from the template.

You then edited code in the .dot file and saved it. And you edited the
styles and content in the .doc file, and saved it.

Have I got the story straight?

If so, then what you're seeing is exactly what should happen. Once a
document is created from a template, it loses all direct association with
its parent template. So changing formatting in a document has no effect at
all on its parent template. For more information, see:

What is the relationship between a Word document and its template?
http://www.ShaunaKelly.com/word/templaterelations\index.html

If you want to edit the template, then you have to use File > Open, open the
template (not a document created from it) and make your changes in the
template. Then, the *next* document that is created from the template will
reflect the changes you've made.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
Thanks for the help.

Well, I just figured it out. It seems that I was opening the template
by double-clicking on the template (while holding down the shift key to
bypass execution of code). It seems that I was opening a document, not
the template. When I open the template from within Word then it opens
as a template and I have no problem - everything gets saved. What a
relief. Such a simple solution.

Thanks for the help.
 
The default action for templates (.dot files) is New rather than Open. You
can right-click on the template and choose Open instead.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Back
Top