Writing Word Macros, Second Edition
An Introduction to Programming Word using VBA
By
Steven Roman, Ph.D.
October 1999
Pages: 410
| Table of Contents
| Index
| Sample Chapter
| Colophon
Table of Contents
-
Chapter 1 Introduction
-
Chapter 2 Preliminaries
-
What Is a Programming Language?
-
Programming Style
-
The VBA Environment
-
Chapter 3 The Visual Basic Editor, Part I
- The Project Window
- The Properties Window
- The Code Window
- The Immediate Window
- Arranging Windows
- Document Events
-
Chapter 4 The Visual Basic Editor, Part II
- Navigating the IDE
- Getting Help
- Creating a Procedure
- Run Mode, Design Mode, and Break Mode
- Errors
- Debugging
- Macros
-
The VBA Programming Language
-
Chapter 5 Variables, Data Types, and Constants
- Comments
- Line Continuation
- Constants
- Variables and Data Types
- VBA Operators
-
Chapter 6 Functions and Subroutines
- Calling Functions
- Calling Subroutines
- Parameters and Arguments
- Exiting a Procedure
- Public and Private Procedures
- Referencing a Project
-
Chapter 7 Built-in Functions and Statements
- The MsgBox Function
- The InputBox Function
- VBA String Functions
- Miscellaneous Functions and Statements
-
Chapter 8 Control Statements
- The If… Then Statement
- The For Loop
- The For Each Loop
- The Do Loop
- The Select Case Statement
- A Final Note on VBA
-
Objects and Object Models
-
Chapter 9 Object Models
- Objects, Properties, and Methods
- Collection Objects
- Object Model Hierarchies
- Object Model Syntax
- Object Variables
-
Chapter 10 The Word Object Model
- The Word Object Model: A Perspective
- Word Enums
- The VBA Object Browser
-
Chapter 11 The Application Object
- Properties and Methods
- The Options Object
- The Task Object
- The Template Object
- The Window Object
- The Pane Object
- The View Object
- The Zoom Object
-
Chapter 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
-
Chapter 13 The Section and HeaderFooter Objects
- Adding a New Section
- The PageSetup Object
- Properties of the Section Object
- The HeaderFooter Object
-
Chapter 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
- Range and Selection Object Properties and Methods
-
Chapter 15 The Find and Replace Objects
- Searching for Text
- Searching for Formatting
- The Replace Operation
- The Execute Method
- Example: Repeated Searching
-
Chapter 16 The Table Object
- Formatting-Related Properties and Methods
- The Cell Method
- The Columns and Rows Properties
- The ConvertToText Method
- Sorting Methods
- The Split Method
- Example: Creating Tables from Word Lists
- Example: Closing Up a Table
-
Chapter 17 The List Object
- List Types
- The List Object
- The ListTemplate Object and ListGalleries
- Example: Looking at Lists
-
Chapter 18 Shortcut Key Bindings
- Finding a Key Binding
- Creating a Key Binding
- The KeyBinding Object
-
Chapter 19 Built-in Dialog Objects
- The Show Method
- The Display and Execute Methods
- The DefaultTab Property
- The Type Property
- The Update Method
- Example: Printing Document Statistics
-
Chapter 20 Custom Dialog Boxes
- What Is a UserForm Object?
- Example: Adding a Closing to a Letter
- Example: A Fax Cover Sheet
- Example: Quick Selection
-
Chapter 21 Menus and Toolbars
- An Overview
- CustomizationContext
- The CommandBars Collection
- The CommandBar Object
- Command Bar Controls
-
Appendixes
-
Appendix Programming Word from Another Application
- Setting a Reference to the Word Object Model
- Getting a Reference to the Word Application Object
- An Alternative Approach
-
Appendix The Shape Object
- The Shape and InLineShape Objects
- Z-Order
- Creating InLineShapes
- Creating Shapes
- Examples
- WordArt
-
Appendix Getting the Installed Printers
-
Appendix High-Level and Low-Level Languages
- BASIC
- Visual Basic
- C and C++
- Visual C++
- Pascal
- FORTRAN
- COBOL
- Lisp
-
Colophon
Return to Writing Word Macros