Share this Page URL

Chapter 18. Working with VBA > Word Macros - Pg. 410

Record a macro (Tools Macro Record New Macro) Word watches your every step in the Word interface and actually records your actions as a Visual Basic for Applications (VBA) script. Useful as this is, record- ing macros doesn't give you the power you can get by writing your own VBA code. Recorded macros tend to be verbose, with lots of unnecessary code. Write your own VBA code (Tools Macro Visual Basic Editor) Create code from scratch with the Visual Basic Editor or record a macro and use its code as a basis. It's often easier to trim out the excess code than to write the code you need from scratch. Using macros is also a quick way to find out the correct syntax for a particular Word operation. Write COM Add-ins The Microsoft Office Developer (MOD) edition of Office 2000 provides de- velopers with tools to write COM (Component Object Model ) Add-ins, which are DLLs (Dynamically Linked Libraries) that extend Word even further than VBA does. Writing COM Add-ins is beyond the scope of this book. Most Word users will find VBA code to have an excellent balance of robustness, power and ease of use. WordBasic and VBA -- A Brief History Word pioneered the customizable interface, allowing users to modify toolbars and menus to suit their needs. It also pioneered the use of a dialect of Basic (WordBasic) to allow users even greater control of the Word environment.