Book description
Many Microsoft Word users and VBA programmers don't realize the extensive opportunities that exist when Word's Object Model is accessed using Visual Basic for Applications (VBA), which replaced WordBasic in conjunction with the release of Word 97. By creating what is commonly called a "Word Macro" you can automate many features available in Word. Writing Word Macros (previously titled Learning Word Programming is the introduction to Word VBA that allows you to do these things and more, including:
Create custom pop-up menus
Automatically create tables from lists
Append one document to the end (or beginning) of another
Create a toggle switch to change a document from draft to final copy by adding or removing a watermark in the header
Generate reports using data from other applications
The Visual Basic Editor and the Word VBA programming environment. Word features a complete and very powerful integrated development environment for writing, running, testing, and debugging VBA macros.
The VBA programming language (which is the same programming language used by Microsoft Excel, Access, and PowerPoint, as well as the retail editions of Visual Basic).
The Word object model. Word exposes nearly all of its functionality through its object model, which allows Word to be controlled programmatically using VBA. While the Word object model, with almost 200 objects, is the largest among the Office applications, readers need be familiar with only a handful of objects. Writing Word Macros focuses on these essential objects, but includes a discussion of a great many more objects as well.
Not intended to be an encyclopedia of Word programming, Writing Word Macros provides Word users, as well as programmers who are not familiar with the Word object model with a solid introduction to writing VBA macros and programs. In particular, the book focuses on:
Writing Word Macros is written in a terse, no-nonsense manner that is characteristic of Steven Roman's straightforward, practical approach. Instead of a slow-paced tutorial with a lot of hand-holding, Roman offers the essential information about Word VBA that you must master to program effectively. This tutorial is reinforced by interesting and useful examples that solve practical programming problems, like generating tables of a particular format, managing shortcut keys, creating fax cover sheets, and reformatting documents. Writing Word Macros is the book you need to dive into the basics of Word VBA programming, enabling you to increase your power and productivity when using Microsoft Word.
Table of contents
-
Writing Word Macros, 2nd Edition
- Preface
- 1. Introduction
- 2. Preliminaries
- I. The VBA Environment
-
II. The VBA Programming Language
-
5. Variables, Data Types, and Constants
- Comments
- Line Continuation
- Constants
- Variables and Data Types
- VBA Operators
- 6. Functions and Subroutines
- 7. Built-in Functions and Statements
- 8. Control Statements
-
5. Variables, Data Types, and Constants
-
III. Objects and Object Models
- 9. Object Models
- 10. The Word Object Model
- 11. The Application Object
-
12. The Document Object
- Properties That Return Collections
- Spelling-Related Properties and Methods
- The Documents Collection
- Adding, Opening, and Saving Documents
- Password-Related Properties
- Protection-Related Properties and Methods
- The Name Properties
- Printing-Related Methods
- Additional Members of the Document Object
- Children of the Document Object
- Example: Printing Document Headings
- Example: Finding Used Styles
- 13. The Section and HeaderFooter Objects
-
14. The Range and Selection Objects
- Comparing the Range and Selection Objects
- Range and Selection Variables
- Creating a Range or Selection Object
-
Changing a Range Object
- The Next and Previous Methods
- The SetRange Method
- The Start and End Properties
- The StartOf and EndOf Methods
- The HomeKey and EndKey Methods
- The Collapse Method
- The Expand Method
- The Extend Method
- The Shrink Method
- The WholeStory Method
- The Move Methods
- The MoveUntil Methods
- The MoveWhile Methods
- The MoveUp, MoveDown, MoveLeft, and MoveRight Methods
- Range and Selection Object Properties and Methods
- 15. The Find and Replace Objects
- 16. The Table Object
-
17. The List Object
- List Types
- The List Object
-
The ListTemplate Object and ListGalleries
- ListGallery Objects
- The ListTemplate Object
- The ListLevel Object
- The ListTemplates Collections
-
The ListFormat Object
- The Apply…Default methods
- The ApplyListTemplate method
- The ConvertNumbersToText method
- The CountNumberedItems method
- The List property
- The ListIndent, ListOutdent, and ListLevelNumber methods
- The ListString and ListValue properties
- The ListTemplate property
- The ListType property
- The RemoveNumbers method
- The SingleList property
- The SingleListTemplate property
- Example: Looking at Lists
- 18. Shortcut Key Bindings
- 19. Built-in Dialog Objects
- 20. Custom Dialog Boxes
- 21. Menus and Toolbars
- IV. Appendixes
- Index
- Colophon
Product information
- Title: Writing Word Macros, Second Edition
- Author(s):
- Release date: October 1999
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565927254
You might also like
book
101 Ready-To-Use Excel Macros
Save time and be more productive with this helpful guide to Excel macros! While most books …
book
Word 2013 Bible
Top-to-bottom coverage of the top-selling Microsoft Office application If you want to use Microsoft Word to …
book
Excel Hacks, 2nd Edition
Millions of users create and share Excel spreadsheets every day, but few go deeply enough to …
book
MS Excel, Second Edition, 2nd Edition
MS Excel is one of the most powerful tools available to a business manager. In this …