Reputation: 177
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!"
Upvotes: 0
Views: 2329
Reputation: 11
Here is what I did:
Replace -738148353 in the example statement below with your value:
selection.Font.Color = (Microsoft.Office.Interop.Word.WdColor)(-738148353);
Upvotes: 1
Reputation: 6971
Take a look at
you won't need to use Com and it allows you to do formating as well
Upvotes: 1