Share via

Visio VB Script Assitance

Anonymous
2016-06-19T07:58:19+00:00

I have some script that will allow me to add a user-defined section and the visLegendShape attribute to a shape. See posted code below.

Sub AddLgnd()

    Dim shp As Visio.Shape

    Set shp = ActiveWindow.Selection(1)

    If Not shp.CellExistsU("User.visLegendShape", False) Then

        shp.AddNamedRow visSectionUser, "visLegendShape", visdefault

    End If

    shp.CellsU("User.visLegendShape").FormulaU = "2"

    If Not Shp.CellExistsU("User.visIsConnected", False) Then

        Shp.AddNamedRow visSectionUser, "visIsConnected", visdefault

    End If

    Shp.CellsU("User.visIsConnected").FormulaU = "0"

End Sub

I would like to add the ability to cycle through all of  the shapes on a drawing or a stencil and set this attribute. Can someone help me with the additional code required to do this.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2016-06-20T05:51:30+00:00

    Hi, rabalam!

    It is not VBS, that is VBA

    Was this answer helpful?

    0 comments No comments