Template Question w/Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having some issues with Word Templates. I have a letter template which has two date fields set, one at the start of the document then one that will appear in the header of the second page should the letter be longer than one page. I've set two bookmarks, one at each date field. Now, most of the people that use this template like the date field so that they can work on a letter for several days and thus the date field keeps the current date on the letter, the second set of people do not want the updaing field and so I created a macro that strips the first date (goes to the first bookmark and replaces the date field with the current date). Here's the problem, when I try to get to the second page (if there is one) and go to the bookmark, the macro can't find it since it's in the header, I've even coded it too open the header first BUT once it starts to search for the header it closes it and then still cannot find the second bookmark. Anyone have an idea how I can get to the second bookmark in the header ? Thanks.
 
Hi,

Instead, try revamping your template. There is a simpler way. I assume that
your first date is on a line by itself that uses the paragraph style "Date."
(If it doesn't, change the template so this is true.) Use a StyleRef field
in the header as follows:
{ StyleRef "Date" }

When the date is changed on the first page, using your macro or manually,
the header will update instantly.

For a non-updating date (which I prefer) use a CreateDate field instead of a
Date field. When I send out a letter and open it two weeks later, I want it
to show the date I sent it, not the current date.

When a letter is first created from your template the CreateDate field will
set the date for the field to display. People who want a different date can
just type it over the field. (In my templates I use two or three fields for
the date to make it easier to manually change. One field is for the day, and
a second or second and third for the month and year.)
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

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

See also the MVP FAQ: <URL: 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.

RichDJ said:
I'm having some issues with Word Templates. I have a letter template
which has two date fields set, one at the start of the document then one
that will appear in the header of the second page should the letter be
longer than one page. I've set two bookmarks, one at each date field. Now,
most of the people that use this template like the date field so that they
can work on a letter for several days and thus the date field keeps the
current date on the letter, the second set of people do not want the updaing
field and so I created a macro that strips the first date (goes to the first
bookmark and replaces the date field with the current date). Here's the
problem, when I try to get to the second page (if there is one) and go to
the bookmark, the macro can't find it since it's in the header, I've even
coded it too open the header first BUT once it starts to search for the
header it closes it and then still cannot find the second bookmark. Anyone
have an idea how I can get to the second bookmark in the header ? Thanks.
 
Back
Top