Previous Document Next Document

Understanding automation : How is automation coding structured? : Using object shortcuts


Using object shortcuts

Shortcuts are provided for some frequently accessed objects. Using shortcuts requires less typing, so shortcuts are easier to use than their longhand versions. (Also, using shortcuts can improve run-time performance because the compiler does not need to determine every object in a long dot-separated reference.)

For CorelDRAW, a shortcut can be used on its own as a property of the Application object. The following table provides these shortcuts and their long forms. (For a description of any item, see the Object Model ReferenceCorelDRAW .)

Shortcut
Long form
ActiveLayer
ActivePage.ActiveLayer
ActivePage
ActiveDocument.ActivePage
ActiveSelection
ActiveDocument.Selection
ActiveSelectionRange
ActiveDocument.SelectionRange
ActiveShape
ActiveDocument.Selection.Shapes(1)
ActiveView
ActiveWindow.ActiveView
ActiveWindow
ActiveDocument.ActiveWindow

For CorelDRAW, the following shortcuts can also be used as members of a given Document object:

 
ActiveLayer
 
ActivePage
 
ActiveShape
 
ActiveWindow

For CorelDRAW, the Document object also has the properties Selection and SelectionRange, which let you get the selection or selection range (respectively) from a specified document regardless of whether that document is active.

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.