我要突出显示与特定组相对应的形状。以下代码仅突出显示与活动页面或母版分组在一起的形状,而不突出显示在活动页面中存在的形状。
Sub CA_Trace_Conflict1()
PCC_CA = InputBox("Enter PCC Band")
'SCC1_CA = InputBox("Enter SCC1 Band")
Dim shp As Visio.Shape
Dim subshp As Visio.Shape
Dim connectorshape As Visio.Shape
Dim BandLinewidth As String
Dim lngShapeIDs() As Long
Dim count As Integer
Dim PCC_flag As Integer
Dim SCC1_flag As Integer
PCC_flag = 0
SCC1_flag = 0
Dim DiagramServices As Integer
DiagramServices = activeDocument.DiagramServicesEnabled
activeDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150
Dim UndoScopeID1 As Long
PCC_CA_space = PCC_CA & " "
For Each shp In Visio.activePage.shapes
If shp.Type = 2 Then 'Check if shp is a group
For Each subshp In shp.shapes
If InStr(shp.Text,PCC_CA_space) > 0 Then
'If PCC_CA Like shp.Text Then
Set connectorshape = shp
Debug.Print shp.Parent
Application.activeWindow.Page.shapes.ItemFromID(shp.ID).CellsSRC(visSectionObject,visRowLine,visLineWeight).FormulaU = "5.5 pt"
' Debug.Print shp.ID
End If
Next
End If
Next
End Sub