2015-06-19 7 views

ответ

0
Option Explicit 

Public Sub LocationTable() 
Dim vsoShapes As Visio.Shapes 
Dim vsoShape As Visio.Shape 
Dim i As Integer 
Dim count As Integer 
Dim shpNo As Integer 
Dim shapeCount As Integer 
Dim shpObj As Visio.Shape, celObj As Visio.Cell 
Dim localcent As Single 
Dim count2 As Integer 


Set vsoShapes = Application.ActiveWindow.Page.Shapes 
For shpNo = 1 To Visio.ActivePage.Shapes.count 
'For Each vsoShape In vsoShapes 
    'shapeCount = vsoShape.Shapes.count 
    'For shapeCount = 1 To vsoShape.Shapes.count 
    Set shpObj = Visio.ActivePage.Shapes(shpNo) 
    If Not shpObj.OneD Then 
     If visTypeGroup = 2 Then 
     Set celObj = shpObj.Cells("width") 
     localcent = celObj.Result("meters") 
      If localcent = 0.74 Then 
       count = count + 1 
       ElseIf localcent = 0.9 Then 

       count2 = count2 + 1 

      End If 
     End If 
    'Next shapeCount 
    End If 
Next shpNo 
End Sub 
+0

У меня есть много типов сгруппированных объектов на странице, мне нужно подсчитать, сколько вхождений для одного типа и сколько для других. Чтобы различать два типа, у меня есть две разные ширины (0,74 и 0,9). Также я хочу, чтобы код исключил другие типы фигур. –

+0

Я пробовал приведенный выше код, и я думаю, что он сделал трюк –

Смежные вопросы