Jay thanks for the good info. I'm still battling along here.
What you suggest adds a watermark to a header without removing the existing
header. If I try the opposite, for example I have a header that is a building
block (a collection of linked images defined as a header building block), and
I want to apply it in a section where there is a watermark (a single linked
image defined as a watermark building block) in that section's header - how
would I do that? Do I use the same code?
From my experience the watermark and everything else gets erased if I use
the WordBasic.RemoveHeader method. I can see that even though the watermark
is a watermark building block, it has a MSOShapeType of 11, as do the other
images in the header I am trying to apply. So does VBA even differentiate
between watermark and header building blocks or the content therein?
Thanks
Robin
Yes, you can use the same code. The macro I posted doesn't look at the
gallery the building block belongs to; it just uses the first building
block whose name matches the BBEname variable. As long as there's only
one building block with that name, the macro is fine.
There can actually be multiple building blocks with the same name, as
long as each one is has a different type/category pair. You can select
a specific building block to insert by type and category. The
principle of collapsing the range in which to insert it still applies.
For example, in my macro, instead of looping through the entire
BuildingBlockEntries collection looking for the name, you could use
Set oBBE = oTempl.BuildingBlockTypes(wdTypeWatermarks) _
.Categories("Confidential").BuildingBlocks(BBEname)
There are a lot more details in the VBA help topic "Working with
Building Blocks".
The WordBasic.RemoveHeader method is a very blunt tool. I'm not
surprised that it nukes everything in the header.
Once a graphic or other object is inserted into the document, VBA
doesn't "know" that it was a building block before it was inserted.
It's just a shape of a particular type (linked picture, text effect
[WordArt], etc.).