Hi all
My problem is about inserting a TextEffect in footers when first (or even)
pages are different.
While Anchor argument works fine for AddShape and AddTextBox methods, the
AddTextEffect ignores it and adds to a different footer. I don't understand
what Word uses to choose the footer for the TextEffect.
Isn't it a Word 2003 VBA bug ?
Here's the VBA code :
Sub Problem()
Dim oDoc As Document
Dim oFooter As HeaderFooter
Dim oRange As Range
Dim oShapes As Shapes, oShape As Shape
' New document with 3 pages and 3 different headers / footers
Set oDoc = Word.Documents.Add
oDoc.PageSetup.DifferentFirstPageHeaderFooter = True
oDoc.PageSetup.OddAndEvenPagesHeaderFooter = True
Set oRange = oDoc.Range
oRange.InsertBreak wdPageBreak
oRange.InsertBreak wdPageBreak
' Add to the second page's footer
Set oFooter = oDoc.Sections(1).Footers(wdHeaderFooterEvenPages)
Set oShapes = oFooter.Shapes
Set oRange = oFooter.Range
' AddTextEffect adds to a different footer !!!
oShapes.AddShape msoShapeHeart, 1, 1, 36, 36, oRange
oShapes.AddTextEffect msoTextEffect10, "TextEffect", _
"Arial Black", 12, msoFalse, msoFalse, 40, 1, oRange
oShapes.AddTextbox(msoTextOrientationHorizontal, 120, 1, 80, 30, oRange)
_
.TextFrame.TextRange.InsertAfter "TextBox"
End Sub
Thank you in advance
McX
Cindy M -WordMVP- - 29 Mar 2005 20:19 GMT
Hi McX,
> My problem is about inserting a TextEffect in footers when first (or even)
> pages are different.
> While Anchor argument works fine for AddShape and AddTextBox methods, the
> AddTextEffect ignores it and adds to a different footer. I don't understand
> what Word uses to choose the footer for the TextEffect.
> Isn't it a Word 2003 VBA bug ?
I'd be happy to test your code, but could you please describe how to set up a
document to properly reproduce the problem?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
McX - 30 Mar 2005 11:05 GMT
Hi Cindy
My code sets up a new document with 3 pages and 3 different headers /
footers.
The only thing to do is to paste and copy the code I've posted into the Word
VBA editor and run it.
McX
"Cindy M -WordMVP-" <C.Meister-C@hispeed.ch> a ?crit dans le message de
news: VA.0000aa86.0030fad1@speedy...
> Hi McX,
>
[quoted text clipped - 18 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)