Very practical when you've got a lot of layers and want to edit or export only objects on one of them...
ATTENTION: Requires LayerExists Function (Page 2)'Turn off all layers except for the one specified
Public Sub LayerSingle(varLayerName As String)
Set myDoc = Application.ActiveDocument
For Each Layer In myDoc.ActivePage.Layers
If LayerExists(varLayerName) Then
If Layer.Name = varLayerName Then Layer.Visible = True Else
Layer.Visible = False
If Layer.Name = varLayerName Then Layer.Editable = True Else
Layer.Editable = False
If Layer.Name = varLayerName Then Layer.Printable = True Else
Layer.Printable = False
Else
MsgBox "Layer doesn't exist!", ,"ATTENTION!"
End If
Next
End Sub
Comments