
Signature
Stefan Blom
Microsoft Word MVP
> It works but it's not adding the header to all the sections. Thanks
>
[quoted text clipped - 86 lines]
>> >> >
>> >> > Mickey
Thank you so much. It works great except it is not carrying over the
bookmarks I have in the autotext header (Smokey). If I run the macro alone
it retains the bookmarks. What I'm doing is running about 4 or 5 macros at
once. The 1st one triggers the 2nd, the 2nd trigger the 3rd, etc. It's then
that I lose the bookmarks. Any suggestions? Thanks again.
> Just loop through all sections, like this:
>
[quoted text clipped - 115 lines]
> >> >> >
> >> >> > Mickey
NZ VBA Developer - 30 Oct 2007 21:35 GMT
Mickey,
I don't think it's possible to have more than one bookmark with the same
name in any given document. Therefore, the behaviour you're seeing is as
expected, and I don't believe it has anything to do with the "chaining" of
the macros. When an AutoText entry containing the bookmark is inserted more
than once, the bookmark will be removed from previous instance of the
AutoText entry and "moved" to the most recently inserted instance.
I conducted a "manual" test to confirm this behaviour. I simply inserted an
AutoText entry containing two bookmarks into a blank document and then
confirmed the existence of the bookmarks. I then inserted another instance of
the same AutoText entry into the same document and checked the status of the
bookmarks. As expected there was only one instance of both bookmarks - both
in the last instance of the AutoText entry.
I suggest running your first macro again and seeing if there are multiple
instances of the same bookmark in the document. (I don't think there will
be.) Then I'd have a look at the follow-on macros and see if any of them are
touching bookmarks in any way - or possibly inserting the same or another
AutoText entry containing a bookmark with the same name. I'd also look to see
if there are _any_ instances of bookmarks from the AutoText entry _anywhere_
in the document - both after running the first macro standalone and after
running the macro "chain". If even the one expected instance is being
deleted, then there's something strange going on. However, if there is only
one instance, then Word is behaving exactly as expected.

Signature
Cheers!
The Kiwi Koder
> Thank you so much. It works great except it is not carrying over the
> bookmarks I have in the autotext header (Smokey). If I run the macro alone
[quoted text clipped - 121 lines]
> > >> >> >
> > >> >> > Mickey
Stefan Blom - 31 Oct 2007 12:45 GMT
All I can think of is to link the headers of the various sections; then you
would only have to insert the AutoText once—and any bookmarks in the
AutoText should be left intact (assuming that the bookmarks don't already
exist somewhere else in the document, of course).

Signature
Stefan Blom
Microsoft Word MVP
> Thank you so much. It works great except it is not carrying over the
> bookmarks I have in the autotext header (Smokey). If I run the macro
[quoted text clipped - 129 lines]
>> >> >> >
>> >> >> > Mickey
Mickey - 01 Nov 2007 01:32 GMT
Would it be possible to write code that would cross-reference the bookmarks
that were lost to the one that was retained?
Thanks again,
Mickey
> All I can think of is to link the headers of the various sections; then you
> would only have to insert the AutoText once—and any bookmarks in the
[quoted text clipped - 134 lines]
> >> >> >> >
> >> >> >> > Mickey
Stefan Blom - 01 Nov 2007 15:11 GMT
Well, my point was that if there is only one header, you wouldn't have to
mess with the bookmarks; they would be preserved, since you would only have
to insert them once (in one of the sections).

Signature
Stefan Blom
Microsoft Word MVP
> Would it be possible to write code that would cross-reference the
> bookmarks
[quoted text clipped - 153 lines]
>> >> >> >> >
>> >> >> >> > Mickey
Mickey - 01 Nov 2007 15:51 GMT
Problem is I have multiple headers that can't be linked together. Some are
portrait pages and some are landscape. I know I can cross reference the
unpreserved bookmarks with the preserved ones. Just wondering if there was
any code to do it.
Thanks again for all your help.
> Well, my point was that if there is only one header, you wouldn't have to
> mess with the bookmarks; they would be preserved, since you would only have
[quoted text clipped - 157 lines]
> >> >> >> >> >
> >> >> >> >> > Mickey
Stefan Blom - 01 Nov 2007 16:02 GMT
OK. I don't know of any such code; but someone else might. :-)

Signature
Stefan Blom
Microsoft Word MVP
> Problem is I have multiple headers that can't be linked together. Some
> are
[quoted text clipped - 182 lines]
>> >> >> >> >> >
>> >> >> >> >> > Mickey