Header/footer VBA code

L

Laura C Johnson

Hello all!

I'm a VBA newbie so please forgive any stupidity on my part. ;)

I have developed a template (it's a .dot but most folks use it as a .doc)
and it will usually be applied to older documents - meaning attaching the
template to the doc and clicking on "automatically update styles."

However - one problem is is that the template contains totally cool
headers/footers and when one attaches the template, the header/footer
doesn't come up.

Is there a way to write VBA code where the current header/footers are
deleted and the ones built in the template are added?

I have written a marco where the margins are changed when a toolbar button
is pushed - but I can't figure out how to assign the cool header/footer to
the doc.

Is this possible? Can anyone assist?

Thanks.

Laura
 
C

Charles Kenyon

It is possible. It is also a lot of work and not worth it in my opinion.
Easier: Create a new document based on your template (with your header and
footer). Paste the contents of the old document into the new one (except for
the last paragraph mark). Save the new document using the old name. The
reason it is a lot of work to automate is that there are a lot of possible
things that can go wrong. Once you do that save, your old document is gone!
Doing it by hand means you see what you are doing before it is too late.

If you have a lot of "documents" that you need to do this for, they probably
should be templates rather than documents. New documents should be based on
templates, not on old documents.
--
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




--------- --------- --------- --------- --------- ---------
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