J
Jon Le Long
I am trying to programmatically insert a WordArt object
into all the headers in all the sections of a document. I
am using the following code:
For Each mySection In ActiveDocument.Sections
If
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter
Then
Set FirstPageWatermark = mySection.Headers
(wdHeaderFooterFirstPage).Shapes.AddTextEffect
(msoTextEffect2, "test", "Arial Black", 36, msoFalse,
msoFalse, 0, 0, mySection.Headers
(wdHeaderFooterFirstPage).Range)
End If
Set PrimaryWatermark = mySection.Headers
(wdHeaderFooterPrimary).Shapes.AddTextEffect
(msoTextEffect2, "test", "Arial Black", 36, msoFalse,
msoFalse, 0, 0, mySection.Headers
(wdHeaderFooterPrimary).Range)
Next
In a document set to use a different first page, the
result I get is that there are two WordArt objects on the
first page and none on the subsequent pages. I suspected
it was down to the Anchor property of the shape, but I
have messed about with various settings to no avail.
I know it can be done using SeekView and moving around
the document, but that does not seem very elegant to me -
especially when you have to put the document in print
layout first and then put it back to whatever the user
had originally, etc.
Anyone got any better ideas?
into all the headers in all the sections of a document. I
am using the following code:
For Each mySection In ActiveDocument.Sections
If
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter
Then
Set FirstPageWatermark = mySection.Headers
(wdHeaderFooterFirstPage).Shapes.AddTextEffect
(msoTextEffect2, "test", "Arial Black", 36, msoFalse,
msoFalse, 0, 0, mySection.Headers
(wdHeaderFooterFirstPage).Range)
End If
Set PrimaryWatermark = mySection.Headers
(wdHeaderFooterPrimary).Shapes.AddTextEffect
(msoTextEffect2, "test", "Arial Black", 36, msoFalse,
msoFalse, 0, 0, mySection.Headers
(wdHeaderFooterPrimary).Range)
Next
In a document set to use a different first page, the
result I get is that there are two WordArt objects on the
first page and none on the subsequent pages. I suspected
it was down to the Anchor property of the shape, but I
have messed about with various settings to no avail.
I know it can be done using SeekView and moving around
the document, but that does not seem very elegant to me -
especially when you have to put the document in print
layout first and then put it back to whatever the user
had originally, etc.
Anyone got any better ideas?