Adding connection points to a shape programatically

X

xargon

Hi everyone,

I have created a shape group in Visio through VBA. What I would like to do
is add connection points to this shape programatically through VBA during
time of creation of the shape.

Is there an API that will allow me to add a few connection points to the
center of the shape?

Thanks and cheers!
Xargon
 
X

xargon

Figured a way to do it. Posting it in case someone else is interested:

Add 4 connection points to a shape

If Not vsoGroupShape.SectionExists(visSectionConnectionPts, 1) Then
vsoGroupShape.AddSection visSectionConnectionPts
End If

Dim rowIndex As Integer
Dim rowCell As Cell
rowIndex = vsoGroupShape.AddRow(visSectionConnectionPts,
visRowConnectionPts, visTagCnnctPt)

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visY)
rowCell.Formula = "Height / 2"

rowIndex = vsoGroupShape.AddRow(visSectionConnectionPts,
visRowConnectionPts, visTagCnnctPt)

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visX)
rowCell.Formula = "Width"

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visY)
rowCell.Formula = "Height / 2"

rowIndex = vsoGroupShape.AddRow(visSectionConnectionPts,
visRowConnectionPts, visTagCnnctPt)

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visX)
rowCell.Formula = "Width / 2"

rowIndex = vsoGroupShape.AddRow(visSectionConnectionPts,
visRowConnectionPts, visTagCnnctPt)

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visX)
rowCell.Formula = "Width / 2"

Set rowCell = vsoGroupShape.CellsSRC(visSectionConnectionPts,
rowIndex, visY)
rowCell.Formula = "Height"
 

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