我不知道Visio VBA,但试一试:
的 UPDATE 强>
Sub selectTest() Dim x As Integer Dim sel As Visio.Selection Dim shp As Visio.Shape Dim inner_shape As Visio.Shape Set sel = ActiveWindow.Selection Set shp = sel.PrimaryItem For x = 1 To shp.Shapes.Count Set inner_shape = shp.Shapes(x) '// Do something with inner shape Next End Sub
使用 Selection.IterationMode 属性以包括选择中的子选定形状
Selection.IterationMode
Set sel = ActiveWindow.Selection sel.IterationMode = 0 Set shp = sel.PrimaryItem