enumerate custom properties

T

travis_

Is there a simple way to enumerate the custom properties of a shape?

// something this would be perfect (if it worked)
foreach (Visio.Cell cell in shape.Cells) {}

There must be a way since the shapesheet is able to do this. I also looked
into enumerating sections (to then enumerate the Shape Data section) without
success.

Apologies if this is answered elsewhere.
 
J

John Goldsmith

Hello Travis,

Here's a VBA example for you:

Sub GetCustomProperties()
Dim shp As Visio.Shape
Dim i As Integer

Set shp = ActiveWindow.Selection.PrimaryItem
If Not shp Is Nothing Then
If shp.SectionExists(visSectionProp, 0) = True Then
For i = 0 To shp.RowCount(visSectionProp) - 1
Debug.Print shp.Section(visSectionProp).Row(i).NameU
Next i
End If
End If

End Sub

Hope that helps.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 

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