F
Frenchy
Hello,
I'm developing an add-in for Word 2003 using VS2003 (Extensibility Projects).
I have to add a textbox in the header and footer.
I tried to record a macro to see how Word does it, but when I record the
macro I can't add the textbox.
So I tried to add a textbox with the anchor of the header. But It says taht
this range isn't part of the document
Here's my code:
Word.Shape ShapeHead;
object anchor =
this.appWord.ActiveDocument.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
ShapeHead =
appWord.ActiveDocument.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal,0,0,50,50, ref anchor);
Does anyone could tell me how to add a textbox in the header/footer ?
In fact I'm using a textbox to be able to update it later. Because the
textbox is a shape and a shape can be accessed by its name. So if you know
other components that do the same, it could help me too.
Thanks
I'm developing an add-in for Word 2003 using VS2003 (Extensibility Projects).
I have to add a textbox in the header and footer.
I tried to record a macro to see how Word does it, but when I record the
macro I can't add the textbox.
So I tried to add a textbox with the anchor of the header. But It says taht
this range isn't part of the document
Here's my code:
Word.Shape ShapeHead;
object anchor =
this.appWord.ActiveDocument.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
ShapeHead =
appWord.ActiveDocument.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal,0,0,50,50, ref anchor);
Does anyone could tell me how to add a textbox in the header/footer ?
In fact I'm using a textbox to be able to update it later. Because the
textbox is a shape and a shape can be accessed by its name. So if you know
other components that do the same, it could help me too.
Thanks