Understanding the CorelDRAW object model : Working with documents : Modifying documents |
You can modify a document regardless of whether it is active.
• |
Modifying an inactive document does not activate that document. To activate a document, you must use
its Activate method (see Activating documents).
|
The following VBA code adds a layer named fooLayer to the third open document:
Dim doc As Document |
Set doc = Documents(3) |
doc.ActivePage.CreateLayer "fooLayer" |
The following VBA code uses the findDocument() function to add a layer named fooLayer to the inactive document named barDoc.cdr:
Dim doc As Document |
Set doc = findDocument("barDoc.cdr") |
If Not doc Is Nothing Then doc.ActivePage.CreateLayer "fooLayer" |
Copyright 2013 Corel Corporation. All rights reserved.