Fill a property on shapes by vba code
Hey guys, Im on a new project in my company and I need to make some things in Visio 2016.
I want to write a vba code that create a property in shape data and then fill it with the container's shape name. Is there possible?
Ive already wrote a code that creat a property "Setor" in all shapes on the page, but I need to fill this property with the name of a container the shapes are into.
The code that Im using is this:
Private Sub Setorizacao()
Dim visShape As Visio.shape
Dim visPage As Visio.Page
Set visPage = ActivePage
For Each visShape In ActivePage.Shapes
If visShape.CellExists("LockWidth", False) Then
Sub InitSetor(ByRef shape As Visio.shape)
' Create Prop.Setor if they don't exist; set both fields to null
If Not shape.CellExistsU("Prop.Setor", False) Then
shape.AddNamedRow visSectionProp, "Setor", visTagDefault
shape.CellsU("Prop.Setor").FormulaU = ""
shape.CellsU("Prop.Setor.Label").FormulaU = Chr(34) & "Setor" & Chr(34)
Thank you in advance.
Lucas, you create one cross-post again ?