drawing a shape programmatically

X

xargon

Hi everyone,

I have a problem with drawing a shape dynamically at run time. I want to
have a rectangle which has many lines drawn dynamically inside it (like a
table). So, I have code like this:

Dim shp1obj As Visio.Shape
Set shp1obj = ActivePage.DrawRectangle(0, 0, 1, 1.5)

Now, when I try to call shp1obj.DrawLine method, it complains that the
method is not supported.

How can I draw lines and add text dynamically to a shape. What I am trying
to do is implement a table like shape in Visio.

Cheers!
xargon
 
C

Chris Roth [ Visio MVP ]

shp1Obj is not a group, and can't contain anything.

You could do something like:

set shpGr = shp1Obj.Group.
shpGr.drawline...

I think something like this will work.

--

Hope this helps,

Chris Roth
Visio MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top