I have a dynamically created textbox that opens in Word.
I am trying to give it one of the default styles in Word 2010 (“Colored Fill, White Outline – Accent 1)
however I have not been able to find the code to do this.
Below is what I have so far, which creates and offsets the textbox:
oDoc = oWord.Documents.Add
Dim titleBanner As Word.Shape
titleBanner = oDoc.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 81.0#, 20.5, 456.75, 24.75)
titleBanner.TextFrame.TextRange.Text = "This is a textbox!"
Take a look at
http://docx.codeplex.com/
you won’t need to use Com and it allows you to do formating as well