J
John
Can anyone tell me what I'm doing wrong? I got a procedure that drops a red
dot ("TestDot") onto the page to the right of each shape that fits a
particular criteria. I've then written another procedure (see below) to
remove the same dots, based on the masters name (again "TestDot"). The weird
thing is that when I run the procedure it only removes some of the dots. I
end up have to run the procedure several times to get rid of all of them.
Any clues on why it doesn't remove the lot in one go?
Thanks
John
Sub RemoveTestDots()
'Removes all shapes in document named "TestDot"
Dim pag As Visio.Page
Dim shp As Visio.Shape
For Each pag In ActiveDocument.Pages
For Each shp In pag.Shapes
If shp.Master.Name = "TestDot" Then
shp.Delete
End If
Next shp
Next pag
End Sub
dot ("TestDot") onto the page to the right of each shape that fits a
particular criteria. I've then written another procedure (see below) to
remove the same dots, based on the masters name (again "TestDot"). The weird
thing is that when I run the procedure it only removes some of the dots. I
end up have to run the procedure several times to get rid of all of them.
Any clues on why it doesn't remove the lot in one go?
Thanks
John
Sub RemoveTestDots()
'Removes all shapes in document named "TestDot"
Dim pag As Visio.Page
Dim shp As Visio.Shape
For Each pag In ActiveDocument.Pages
For Each shp In pag.Shapes
If shp.Master.Name = "TestDot" Then
shp.Delete
End If
Next shp
Next pag
End Sub