Manipulate CorelDraw layers

LayerSingle

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

You might also like...

Comments

About the author

 Thamar

Thamar Poland

I was born in a small town in Holland, and currently live in Poland. I'm fluent in English, German, Polish and Dutch, speak a bit of French and Russian. After finishing Information Technologies ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” - Bjarne Stroustrup