Example: dental hygienist

VBA Programming Guide for CorelDRAW® 11

VBA Programming Guide for coreldraw 11 The contents of this Programming Guide and the associated coreldraw software are the property of CorelCorporation and its respective licensors, and are protected by copyright. For more complete copyright informationabout coreldraw , please refer to the About coreldraw section in the Help menu of the software. 2002 Corel Corporation. All rights , the Corel logo, coreldraw , Corel PHOTO-PAINT, Corel SCRIPT, and WordPerfect are trademarks orregistered trademarks of Corel Corporation and/or its subsidiaries in Canada, the , and/or other , visual Basic, visual Studio, ActiveX, and Windows are registered trademarks of Microsoft Corporation inthe United States and/or other countries. AutoCAD is a registered trademark of Autodesk, Inc. Borland and Delphiare trademarks or registered trademarks of Borland Software Corporation.

Introduction 1 Welcome to the Visual Basic for Applications Programming Guide for CorelDRAW 11. What’s the purpose of this guide? The purpose of this document is to describe how to develop and distribute Visual Basic for Applications (VBA)

Tags:

  Guide, Programming, Basics, Visual, Coreldraw, Visual basic, Vba programming guide for coreldraw, Programming guide for coreldraw

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of VBA Programming Guide for CorelDRAW® 11

1 VBA Programming Guide for coreldraw 11 The contents of this Programming Guide and the associated coreldraw software are the property of CorelCorporation and its respective licensors, and are protected by copyright. For more complete copyright informationabout coreldraw , please refer to the About coreldraw section in the Help menu of the software. 2002 Corel Corporation. All rights , the Corel logo, coreldraw , Corel PHOTO-PAINT, Corel SCRIPT, and WordPerfect are trademarks orregistered trademarks of Corel Corporation and/or its subsidiaries in Canada, the , and/or other , visual Basic, visual Studio, ActiveX, and Windows are registered trademarks of Microsoft Corporation inthe United States and/or other countries. AutoCAD is a registered trademark of Autodesk, Inc. Borland and Delphiare trademarks or registered trademarks of Borland Software Corporation.

2 WinZip is a registered trademark ofWinZip Computing, Inc. PostScript is a registered trademark of Adobe Systems Incorporated in the United Statesand/or other countries. Java and JavaScript are trademarks of Sun Microsystems, Inc. Other product, font, andcompany names and logos may be trademarks or registered trademarks of their respective Programming Guide for coreldraw 112 Table of s the purpose of this Guide ?..7 Who should use this Guide ?..7 How to use this VBA in Corel and running macros in VBA for VBA toolbar in a macros in the VB a automation and is automation?..14 VBA for for main features of VBA structure and VBA to other Programming Basic the visual Basic Editor from Basic Editor user Designer Browser Programming Guide for coreldraw objects and object objects, properties, methods, and purpose and benefits of using an object references to objects using Set.

3 46 Collections of objects in with basic ActiveDocument between content in active and inactive the undo ActivePage between and renaming a layer as and hiding Programming Guide for coreldraw 114 Shape and selecting the properties of to frequently used and closing and exporting to and and to user interfaces for with dialog modal or modeless dialog dialog box with toolbars and new a caption and a tooltip to an image or an icon to a with the and help to the Programming Guide for coreldraw 115 Organizing, grouping, & deploying coreldraw and grouping of distributing macros using a GMS and installing project workspace menus, toolbars, and shortcut to get more Solution Developers Corporate Customized Programming Guide for coreldraw 116 Introduction1 Welcome to the visual Basic for Applications Programming Guide for coreldraw s the purpose of this Guide ?

4 The purpose of this document is to describe how to develop and distribute visual Basic for Applications (VBA)solutions in coreldraw 11. It introduces the VBA integrated development environment and many of its advancedfeatures. It also describes the most important coreldraw functions and how to use them. Finally, this guidedescribes how to package and deploy VBA solutions developed for Guide should be read in conjunction with the coreldraw object model reference document available in theCorelDRAW application should use this Guide ?This Guide should be used by anyone who is interested in automating simple and complex tasks in coreldraw orwho is developing commercial solutions that integrate with is assumed that the reader already has experience with at least one other procedural Programming language, suchas BASIC, visual Basic, C, C++, Java , Pascal, Cobol, or Fortran.

5 This Guide does not describe the basics ofprocedural Programming , such as functions, conditional branching, and looping. Non-programmers should firstlearn the basics of Programming in a language such as visual Basic or VBA before using this document to developCorelDRAW to use this guideThis Guide is organized into chapters that deal with specific aspects of automating tasks and building solutions CorelDRAWC orelDRAW is a comprehensive vector-based drawing program that makes it easy to create professional artworkfrom simple logos to technical illustrations. The tools in coreldraw are designed to meet the demands of thegraphic arts VBA in CorelDRAWIn 1995, Corel incorporated automation into coreldraw 6 by including its Corel SCRIPT language. Thisenabled solution developers to create intelligent mini-applications within coreldraw , such as ones that drawshapes, reposition and resize shapes, open and close documents, set styles, and so SCRIPT was included with coreldraw versions 6 through 9.

6 Although the Corel SCRIPT editor is notincluded with coreldraw in versions after 9, the run-time engine is included, so scripts written for earlier versionsof coreldraw can easily be migrated to the latest 1998, Corel took the strategic decision to augment the Corel SCRIPT functionality of coreldraw 9 by licensingthe Microsoft visual Basic for Applications engine to handle its behind-the-scenes automation. The addition of VBAVBA Programming Guide for coreldraw 117made coreldraw immediately accessible to millions of existing VBA developers, as well as visual Basic developers,around the in coreldraw can be used as a platform for developing powerful corporate graphical solutions, such asautomated ticket generators, customized calendars, and batch processing of files. VBA can also be used to enhanceand optimize the workflow within coreldraw .

7 For example, you can improve and customize some of the built-infunctionality of coreldraw (alignments, transformations, object creation), or add page layouts on-the-fly(company letterheads).VBA comes with a fully integrated development environment that provides contextual pop-up lists, syntaxhighlighting, line-by-line debugging, and visual designer windows. These helpful prompts and aids create aparticularly friendly environment for inexperienced developers to learn Corel CorporationFounded in 1985, Corel Corporation ( ) is a leading technology company that offers softwarefor home and small business users, creative professionals and enterprise customers. With its headquarters in Ottawa,Canada, Corel s common stock trades on the Nasdaq Stock Market under the symbol CORL and on the TorontoStock Exchange under the symbol Programming Guide for coreldraw 118 IntroductionChapter 1 Writing and running macros in CorelDRAW2 Before you can develop and run macros in coreldraw , it may be necessary to install the VBA VBA for CorelDRAWWith coreldraw 11, VBA is installed as part of the typical install.

8 In coreldraw 10, VBA must be custom install VBA:1 Insert Disc 1 of the installation CD into your computer s CD drive. If the installer does not autostart,double-click on the file D:\ , where D: is the drive letter of your computer's CD the installer autostarts, click on "Install coreldraw Graphics Suite 11".VBA Programming Guide for coreldraw 119 coreldraw 11 installer3 Enable theCustomoption and clickNext:4 Now navigate down the tree to Corel Graphics Suite 11\Main Applications\Utilities\ and enable the visual Basicfor Applications & IE 5 check Any components whose check boxes you disabled will be Programming Guide for coreldraw 1110 Writing and running macros in CorelDRAWC hapter 2 Enable the visual Basic for Applications check boxThe Installation wizardThe academic versions of coreldraw 10 and 11 do not include the VBA VBA toolbar in CorelDRAWC orelDRAW has a toolbar that provides easy access to several VBA features, and to the VB toolbar buttons provide the following functions.

9 Playing macros opening the VB Editor switching the VB Editor between design and run modes recording macros pausing the recording of macros stopping the recording of macrosThese features are described in subsequent display the VBA toolbar, right-click anywhere on an empty toolbar area and choose visual Basic forApplications from the pop-up menu. Alternatively, chooseTools}Toolbars} visual Basic for a macroMacros can only be written inside the VB Editor. However, you can save time byrecordingactions withinCorelDRAW. Recording creates a new VBA macro in the chosen project, which can then be edited and customizedin the VB macros in the VB EditorMacros that are developed in the VB Editor can take advantage of full programmatical control, includingconditional execution, looping, and branching. Macros that include this extra functionality are more than mere macros , but are programs in their own right.

10 However, for the purpose of this Guide , all VBA code is referred to asa macro , although in some contexts a macro is just those parts of that code that can be launched by the VB Editor to develop macros is described in detail in the chapter visual Basic Editor .Recording macrosIt is often very useful to record macros, particularly when you are not familiar with coreldraw s object model, orwhen you are not sure which objects and methods to use. For many simple and repetitive tasks, recorded macros area quick, efficient solution. Recorded macros are macros in the truest sense of the word: strictly speaking a macro is arecorded set of actions within the application that can be repeatedly invoked. This is exactly what is created whenyou record a macro a true copy of your actions within coreldraw , although this is limited to coreldraw actions, and does not simply record keystrokes and mouse Programming Guide for coreldraw 1111 Writing and running macros in CorelDRAWC hapter 2 The VBA toolbar in CorelDRAWTo record a new macro:1 ClickTools} visual Basic}Record, or click on the Record button on the VBA a name in theMacro Namebox.


Related search queries