Insert AutoShape in word doc using VS 2005

pasensyoso_manigbas

Well-known member
Joined
May 19, 2006
Messages
64
Programming Experience
Beginner
hi guys!

Before anything else, good day to ya'll!

I'm back again, hopefully I'm posting in the right discussion board. Well, I'm trying to learn more on Office Automation again, can someone give me a little light on how to insert AutoShape in a word document using VS 2005? I'm googling on this for an hour, and most results I've seen is simply a word tutorial on this.:mad:

Best Regards to John, JM and the rest of the guys for helping me the last time I was here. Thanks for sharing your expertise guys!
 
Thanks John, I have figured it out.

Ow, one more thing, I can't apply text inside the Shape. The one we usually do in winword like right-click then "add text", that thing I can't get to work.

I can't seemed to find any other option there except for

"TextEffect.Text" which is I set to something like

VB.NET:
  TextEffect.Text ="Some text"

please take a look at what I've done

VB.NET:
the_shape = oShape.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeCube, 200, 10, 200, 50)
        With the_shape
            .Name = "Square"
            .TextEffect.Text = "Some text"
            .Fill.BackColor.RGB = RGB(0, 0, 0)
            .Fill.ForeColor.RGB = RGB(150, 150, 150)
            .Fill.Solid()
        End With

pointing to TextEffect.Text property, the error says "This member is only accessible to WordArt Object"

Is there any other way to add text? Or I just miss something?
 
Last edited:
In that help topic it says the method "Returns a Shape object" where "Shape" is a link to help topic for Shape interface, in the overview text in that page is says this:
The TextFrame property returns the TextFrame object, which contains all the properties and methods for attaching text to shapes and linking the text between text frames.
It sounds like this is what you are interested in.
 
Yeah, that was it. I have it working now.

Thanks a lot. Best Regards!
 
Back
Top