M
McX
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
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