Something like:
dim shp as visio.shape
dim layer as visio.layer
for each shp in layer("Name")
shp.delete
next
Any help very much appreciated!
Robert
Check this out:
Sub MarkShapesOnBobLayer()
' Add shapes to page. Put some of them on a layer named "Bob"
Dim s As Visio.Shape
Dim i As Integer, j As Integer
Dim lTarget As Visio.Layer, l As Visio.Layer
' This is the layer object in the page:
Set lTarget = ActivePage.Layers.Item("Bob")
For Each s In ActivePage.Shapes
' Check the layers that the shape belongs to:
For j = 0aTo s.LayerCount
Set l = s.Layer(j)
If l.NameU = lTarget.NameU Then s.Text = "Delete me"
Next j
Next
End Sub
Remember that if you really want to delete the shapes in this loop, you
should make a backwards for loop that goes from ActivePage.Shapes.Count to 1
step -1. Then, when you delete shapes, it won't mess up your loop.
--
Hope this helps,
Chris Roth
Visio MVP
"Thijs Schoemaker" <th...@bcd.nl> wrote in message
news:%231r$3$vQEH...@TK2MSFTNGP10.phx.gbl...
"Chris Roth [ Visio MVP ]" <visi...@reallyreallywarmmail.com> wrote in
message news:%23PMxxay...@TK2MSFTNGP10.phx.gbl...