![]() |
![]() |
Application.ActiveDocument
Property ActiveDocument As Document
Member of Application
The ActiveDocument property returns a reference to the active document.
You do not need to activate a document before working with it in CorelDRAW. The document stays inactive but you still can work with it. For example, examine the following two lines of code:
These two lines of code produce the same result as the following:
Both of these examples add a new page to the first open document, which is the first document.
The ActiveDocument property returns a read-only value.
The following code example creates a new document and draws an ellipse in it. Then another document is created, and a rectangle is added to it. The first document is then activated and a new page is added to it.
Sub DocumentActive() CreateDocument ActiveLayer.CreateEllipse2 3, 2, 1 CreateDocument ActiveLayer.CreateRectangle 2, 3, 4, 5 Documents(1).Activate ActiveDocument.AddPages 1 End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.