If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
VBA - removing object from layer
I am using the following macro to selectively add connectors to a
specific layer. There is a complication though: every connector on my page belongs to a layer called 'connector', which I don't want. I want to somehow remove everything from that layer without deleting the shapes, or remove every shape from that layer. Is there a variation of this code that will remove something from a layer? I have tried many permutations but with no success. Thanks in advance! --- Public Sub MoveToLayer() Dim objShps As Visio.Selection, objShp As Visio.Shape Dim objLayers As Visio.Layers, objLayer As Visio.Layer Dim i As Integer 'get the Selection Set objShps = Visio.ActiveWindow.Selection 'get the layers collection Set objLayers = Visio.ActivePage.Layers Set objLayer = objLayers("Shapes") For i = 1 To objShps.Count Set objShp = objShps(i) objLayer.Add objShp, 0 Next i End Sub |
Thread Tools | |
Display Modes | |
|
|