You can retrieve the header through code using:
activedocument.StoryRanges(wdPrimaryHeaderStory)
Set this range to whatever you want the header to be; that will replace
anything that is there already. Or, in your current code, start by selecting
the existing header and delete it.
Use wdEvenPagesHeaderStory and wdFirstPageHeaderStory if your layout has
multiple headers.
Quote:
> We have a document which prints on a pre-printed form, and is also used to
> make a PDF file for e-mail. For the PDF we have a macro which adds a
header,
> and another to remove the header. Several documents may be open at the
same
> time to be e-mailed. One problem we have is occasionally the header is
> applied twice to a document. What could I add to the code to prevent
adding
> the header a second time?
> Thanks,
> Steve Hodgkin