Book description
A comprehensive guide to the language used to customize Microsoft Office
Visual Basic for Applications (VBA) is the language used for writing macros, automating Office applications, and creating custom applications in Word, Excel, PowerPoint, Outlook, and Access. This complete guide shows both IT professionals and novice developers how to master VBA in order to customize the entire Office suite for specific business needs.
Office 2010 is the leading productivity suite, and the VBA language enables customizations of all the Office programs; this complete guide gives both novice and experienced programmers the knowledge they need to make maximum use of VBA for Office
Supported with real-world examples in Word, Excel, PowerPoint, Outlook, and Access, this book offers clear, systematic tutorials with both intermediate and advanced content
Covers learning how to work with VBA; recording macros; using loops and functions; using message boxes, input boxes, and dialog boxes; creating effective code; XML-based files; ActiveX; the developer tab; content controls; add-ins; embedded macros; and security
Mastering VBA for Office 2010 prepares developers to customize all Microsoft Office 2010 applications for the unique needs of their employers.
Table of contents
- Copyright
- Dear Reader,
- Acknowledgments
- About the Author
- Introduction
-
1. Recording Macros and Getting Started with VBA
-
1. Recording and Running Macros in the Office Applications
- 1.1. What Is VBA and What Can You Do with It?
- 1.2. Understanding Macro Basics
-
1.3. Recording a Macro
- 1.3.1. Planning the Macro
- 1.3.2. Starting the Macro Recorder
- 1.3.3. Naming the Macro
- 1.3.4. Assigning a Way to Run a Macro
- 1.4. Running a Macro
- 1.5. Recording a Sample Word Macro
- 1.6. Recording a Sample Excel Macro
- 1.7. Assigning a Way of Running the Macro
- 1.8. Deleting a Macro
- 1.9. The Bottom Line
-
2. Getting Started with the Visual Basic Editor
- 2.1. Opening the Visual Basic Editor
- 2.2. Using the Visual Basic Editor's Main Windows
- 2.3. Setting Properties for a Project
-
2.4. Customizing the Visual Basic Editor
- 2.4.1. Choosing Editor and View Preferences
- 2.4.2. Choosing and Laying Out the Editor Windows
- 2.4.3. Customizing the Toolbar and Menu Bar
-
2.4.4. Customizing the Toolbox
- 2.4.4.1. Adding Controls to the Toolbox
- 2.4.4.2. Renaming a Toolbox Control
- 2.4.4.3. Assigning a Picture to a Control's Toolbox Icon
- 2.4.4.4. Removing Controls from the Toolbox
- 2.4.4.5. Adding Pages to the Toolbox
- 2.4.4.6. Renaming Pages in the Toolbox
- 2.4.4.7. Removing Pages from the Toolbox
- 2.4.4.8. Importing and Exporting Toolbox Pages
- 2.4.4.9. Moving Pages in the Toolbox
- 2.5. Closing the Visual Basic Editor and Returning to the Host Application
- 2.6. The Bottom Line
- 3. Editing Recorded Macros
- 4. Creating Code from Scratch in the Visual Basic Editor
-
1. Recording and Running Macros in the Office Applications
-
2. Learning How to Work with VBA
- 5. Understanding the Essentials of VBA Syntax
- 6. Working with Variables, Constants, and Enumerations
-
7. Using Array Variables
- 7.1. What Is an Array?
- 7.2. Declaring an Array
- 7.3. Storing Values in an Array
- 7.4. Multidimensional Arrays
- 7.5. Declaring a Dynamic Array
- 7.6. Redimensioning an Array
- 7.7. Returning Information from an Array
- 7.8. Erasing an Array
- 7.9. Finding Out Whether a Variable Is an Array
- 7.10. Finding the Bounds of an Array
- 7.11. Sorting an Array
- 7.12. Searching through an Array
- 7.13. The Bottom Line
-
8. Finding the Objects, Methods, and Properties You Need
- 8.1. What Is an Object?
- 8.2. Working with Collections
- 8.3. Finding the Objects You Need
- 8.4. Using Object Variables to Represent Objects
- 8.5. The Bottom Line
-
3. Making Decisions and Using Loops and Functions
-
9. Using Built-in Functions
- 9.1. What Is a Function?
- 9.2. Using Functions
-
9.3. Using Functions to Convert Data from One Type to Another
- 9.3.1. Using the Asc Function to Return a Character Code
- 9.3.2. Using the Val Function to Extract a Number from the Start of a String
- 9.3.3. Using the Str Function to Convert a Value to a String
- 9.3.4. Using the Format Function to Format an Expression
- 9.3.5. Using the Chr Function and Constants to Enter Special Characters in a String
-
9.4. Using Functions to Manipulate Strings
- 9.4.1. Using the Left, Right, and Mid Functions to Return Part of a String
- 9.4.2. Using InStr and InStrRev to Find a String within Another String
- 9.4.3. Using LTrim, RTrim, and Trim to Trim Spaces from a String
- 9.4.4. Using Len to Check the Length of a String
- 9.4.5. Using StrConv, LCase, and UCase to Change the Case of a String
- 9.4.6. Using the StrComp Function to Compare Apples to Apples
- 9.5. Using VBA's Mathematical Functions
- 9.6. Using VBA's Date and Time Functions
- 9.7. Using File-Management Functions
- 9.8. The Bottom Line
- 10. Creating Your Own Functions
-
11. Making Decisions in Your Code
- 11.1. How Do You Compare Things in VBA?
- 11.2. Testing Multiple Conditions by Using Logical Operators
- 11.3. Select Case Statements
- 11.4. The Bottom Line
- 12. Using Loops to Repeat Actions
-
9. Using Built-in Functions
-
4. Using Message Boxes, Input Boxes, and Dialog Boxes
-
13. Getting User Input with Message Boxes and Input Boxes
- 13.1. Opening a Procedure to Work On
- 13.2. Displaying Status Bar Messages in Word and Excel
-
13.3. Message Boxes
- 13.3.1. The Pros and Cons of Message Boxes
- 13.3.2. Message Box Syntax
- 13.3.3. Displaying a Simple Message Box
- 13.3.4. Displaying a Multiline Message Box
- 13.3.5. Choosing Buttons for a Message Box
- 13.3.6. Choosing an Icon for a Message Box
- 13.3.7. Setting a Default Button for a Message Box
- 13.3.8. Controlling the Modality of a Message Box
- 13.3.9. Specifying a Title for a Message Box
- 13.3.10. Title Bars Can Provide Useful Information
- 13.3.11. Adding a Help Button to a Message Box
- 13.3.12. Specifying a Help File for a Message Box
- 13.3.13. Using Some Arguments without Others
- 13.3.14. Retrieving a Value from a Message Box
- 13.4. Input Boxes
- 13.5. Forms: When Message Boxes and Input Boxes Won't Suffice
- 13.6. The Bottom Line
-
14. Creating Simple Custom Dialog Boxes
- 14.1. When Should You Use a Custom Dialog Box?
-
14.2. Creating a Custom Dialog Box
- 14.2.1. Designing the Dialog Box
- 14.2.2. Inserting a User Form
- 14.2.3. Renaming a User Form
- 14.2.4. Adding Controls to the User Form
- 14.2.5. Renaming Controls
- 14.2.6. Moving a Control
- 14.2.7. Changing the Caption on a Control
-
14.2.8. Key Properties for the Toolbox Controls
- 14.2.8.1. Common Properties
- 14.2.8.2. Label
- 14.2.8.3. TextBox
- 14.2.8.4. ComboBox and ListBox
- 14.2.8.5. CheckBox
- 14.2.8.6. OptionButton
- 14.2.8.7. ToggleButton
- 14.2.8.8. Frame
- 14.2.8.9. CommandButton
- 14.2.8.10. TabStrip and MultiPage
- 14.2.8.11. ScrollBar and SpinButton
- 14.2.8.12. Image
- 14.2.8.13. Page
- 14.2.8.14. Tab
- 14.2.9. Working with Groups of Controls
- 14.2.10. Aligning Controls
- 14.2.11. Placing Controls
- 14.2.12. Adjusting the Tab Order of the Dialog Box
- 14.3. Linking a Dialog Box to a Procedure
- 14.4. Retrieving the User's Choices from a Dialog Box
- 14.5. Examples of Connecting Dialog Boxes to Procedures
- 14.6. Using an Application's Built-in Dialog Boxes from VBA
- 14.7. The Bottom Line
-
15. Creating Complex Dialog Boxes
- 15.1. Creating and Working with Complex Dialog Boxes
-
15.2. Using Events to Control Forms
- 15.2.1. Events That Apply Only to the UserForm Object
- 15.2.2. Events That Apply to the UserForm Object and to Container Controls
-
15.2.3. Events That Apply to Many or Most Controls
- 15.2.3.1. Click Event
- 15.2.3.2. Change Event
- 15.2.3.3. Enter and Exit Events
- 15.2.3.4. BeforeUpdate Event
- 15.2.3.5. AfterUpdate Event
- 15.2.3.6. KeyDown and KeyUp Events
- 15.2.3.7. KeyPress Event
- 15.2.3.8. MouseDown Event and MouseUp Event
- 15.2.3.9. MouseMove Event
- 15.2.3.10. BeforeDragOver Event
- 15.2.3.11. BeforeDropOrPaste Event
- 15.2.3.12. DblClick Event
- 15.2.3.13. Error Event
- 15.2.4. Events That Apply Only to a Few Controls
- 15.3. The Bottom Line
-
13. Getting User Input with Message Boxes and Input Boxes
-
5. Creating Effective Code
-
16. Building Modular Code and Using Classes
-
16.1. Creating Modular Code
- 16.1.1. What Is Modular Code?
- 16.1.2. Advantages of Using Modular Code
- 16.1.3. How to Approach Creating Modular Code
- 16.1.4. Arranging Your Code in Modules
- 16.1.5. Calling a Procedure
-
16.1.6. Making Logical Improvements to Your Code
- 16.1.6.1. Declaring Variables Explicitly instead of Implicitly
- 16.1.6.2. Using With Statements to Simplify Your Code
- 16.1.6.3. Don't Use With Statements Pointlessly
- 16.1.6.4. Optimizing Your Select Case Statements
- 16.1.6.5. Don't Check Things Pointlessly
- 16.1.6.6. Removing Unused Elements from Your Code
-
16.1.7. Making Visual Improvements to Your Code
- 16.1.7.1. Indenting the Different Levels of Code
- 16.1.7.2. Using Line-Continuation Characters to Break Long Lines
- 16.1.7.3. Using the Concatenation Character to Break Long Strings
- 16.1.7.4. Using Blank Lines to Break Up Your Code
- 16.1.7.5. Using Variables to Simplify Complex Syntax
- 16.1.7.6. Passing Information from One Procedure to Another Using Arguments
- 16.1.7.7. Passing Information from One Procedure to Another Using Private or Public Variables
-
16.2. Creating and Using Classes
- 16.2.1. What Can You Do with Class Modules?
- 16.2.2. A Brief Overview
- 16.2.3. Planning Your Class
- 16.2.4. Creating the Class Module
- 16.2.5. Naming the Class
- 16.2.6. Setting the Instancing Property
- 16.2.7. Declaring Variables and Constants for the Class
- 16.2.8. Adding Properties to the Class
- 16.2.9. Adding Methods to the Class
- 16.2.10. Using Your Class
- 16.3. The Bottom Line
-
16.1. Creating Modular Code
-
17. Debugging Your Code and Handling Errors
- 17.1. Principles of Debugging
- 17.2. The Different Types of Errors
- 17.3. VBA's Debugging Tools
- 17.4. Dealing with Infinite Loops
- 17.5. Dealing with Runtime Errors
- 17.6. Suppressing Alerts
- 17.7. Handling User Interrupts in Word, Excel, and Project
- 17.8. Documenting Your Code
- 17.9. The Bottom Line
-
18. Building Well-Behaved Code
- 18.1. What Is a Well-Behaved Procedure?
- 18.2. Retaining or Restoring the User Environment
- 18.3. Leaving the User in the Best Position to Continue Working
- 18.4. Keeping the User Informed during the Procedure
- 18.5. Making Sure a Procedure Is Running under Suitable Conditions
- 18.6. Cleaning Up after a Procedure
- 18.7. The Bottom Line
-
19. Securing Your Code with VBA's Security Features
- 19.1. Understanding How VBA Implements Security
-
19.2. Signing Your Macro Projects with Digital Signatures
- 19.2.1. What Is a Digital Certificate?
-
19.2.2. Getting a Digital Certificate
- 19.2.2.1. Creating a Digital Certificate of Your Own
- 19.2.2.2. Getting a Digital Certificate from Your Company
- 19.2.2.3. Getting a Digital Certificate from a Commercial Certification Authority
- 19.2.2.4. Installing a Digital Certificate
- 19.2.2.5. Exporting a Digital Certificate
- 19.2.2.6. Removing a Digital Certificate
- 19.2.2.7. Signing a Macro Project with a Digital Signature
- 19.2.2.8. Removing a Digital Signature from a Macro Project
- 19.2.2.9. Whose Certificate Is It, and What Does It Mean?
- 19.3. Choosing a Suitable Level of Security
- 19.4. Locking Your Code
- 19.5. The Bottom Line
-
16. Building Modular Code and Using Classes
-
6. Programming the Office Applications
-
20. Understanding the Word Object Model and Key Objects
- 20.1. Examining the Word Object Model
- 20.2. Working with the Documents Collection and the Document Object
-
20.3. Working with the Selection Object
- 20.3.1. Checking the Type of Selection
- 20.3.2. Checking the Story Type of the Selection
- 20.3.3. Getting Other Information about the Current Selection
- 20.3.4. Inserting Text at, after, or before the Selection
- 20.3.5. Inserting a Paragraph in a Selection
- 20.3.6. Applying a Style
- 20.3.7. Extending a Selection
- 20.3.8. Collapsing a Selection
- 20.4. Creating and Using Ranges
- 20.5. Manipulating Options
- 20.6. The Bottom Line
-
21. Working with Widely Used Objects in Word
- 21.1. Using Find and Replace via VBA
-
21.2. Working with Headers, Footers, and Page Numbers
- 21.2.1. Understanding How VBA Implements Headers and Footers
- 21.2.2. Getting to a Header or Footer
- 21.2.3. Checking to See If a Header or Footer Exists
- 21.2.4. Linking to the Header or Footer in the Previous Section
- 21.2.5. Creating a Different First-Page Header
- 21.2.6. Creating Different Odd- and Even-Page Headers
-
21.2.7. Adding Page Numbers to Your Headers and Footers
- 21.2.7.1. Adding Page Numbers to One or More Sections of a Document
- 21.2.7.2. Removing Page Numbers from One or More Sections of a Document
- 21.2.7.3. Finding Out If a Section of a Document Has Page Numbers
- 21.2.7.4. Changing the Page Numbering for a Section
- 21.2.7.5. Suppressing the Page Number for the First Page
- 21.2.7.6. Formatting Page Numbers
- 21.2.7.7. Creating "Page X of Y" Type Page Numbers
-
21.3. Working with Sections, Page Setup, Windows, and Views
- 21.3.1. Adding a Section to a Document
- 21.3.2. Changing the Page Setup
- 21.3.3. Opening a New Window Containing an Open Document
- 21.3.4. Closing All Windows for a Document Except the First
- 21.3.5. Splitting a Window
- 21.3.6. Displaying the Document Map for a Window
- 21.3.7. Scrolling a Window
- 21.3.8. Arranging Windows
- 21.3.9. Positioning and Sizing a Window
- 21.3.10. Making Sure an Item Is Displayed in the Window
- 21.3.11. Changing a Document's View
- 21.3.12. Zooming the View to Display Multiple Pages
-
21.4. Working with Tables
- 21.4.1. Creating a Table
- 21.4.2. Selecting a Table
- 21.4.3. Converting Text to a Table
- 21.4.4. Making Sure the Selection Is within a Table
- 21.4.5. Finding Out Where a Selection Is within a Table
- 21.4.6. Sorting a Table
- 21.4.7. Adding a Column to a Table
- 21.4.8. Deleting a Column from a Table
- 21.4.9. Setting the Width of a Column
- 21.4.10. Selecting a Column
- 21.4.11. Adding a Row to a Table
- 21.4.12. Deleting a Row from a Table
- 21.4.13. Setting the Height of One or More Rows
- 21.4.14. Selecting a Row
- 21.4.15. Inserting a Cell
- 21.4.16. Returning the Text within a Cell
- 21.4.17. Entering Text in a Cell
- 21.4.18. Deleting Cells
- 21.4.19. Selecting a Range of Cells
- 21.4.20. Converting a Table or Rows to Text
- 21.5. The Bottom Line
-
22. Understanding the Excel Object Model and Key Objects
- 22.1. Getting an Overview of the Excel Object Model
- 22.2. Understanding Excel's Creatable Objects
- 22.3. Managing Workbooks
- 22.4. Working with Worksheets
- 22.5. Working with the Active Cell or Selection
- 22.6. Working with Ranges
- 22.7. Setting Options
- 22.8. The Bottom Line
-
23. Working with Widely Used Objects in Excel
- 23.1. Working with Charts
- 23.2. Working with Windows
- 23.3. Working with Find and Replace
- 23.4. Adding Shapes
- 23.5. The Bottom Line
-
24. Understanding the PowerPoint Object Model and Key Objects
- 24.1. Getting an Overview of the PowerPoint Object Model
- 24.2. Understanding PowerPoint's Creatable Objects
-
24.3. Working with Presentations
- 24.3.1. Creating a New Presentation Based on the Default Template
- 24.3.2. Creating a New Presentation Based on a Template
- 24.3.3. Opening an Existing Presentation
- 24.3.4. Saving a Presentation
- 24.3.5. Closing a Presentation
- 24.3.6. Exporting a Presentation or Some Slides to Graphics
- 24.3.7. Printing a Presentation
- 24.3.8. Applying a Template to a Presentation, to a Slide, or to a Range of Slides
- 24.3.9. Working with the Active Presentation
- 24.4. Working with Windows and Views
-
24.5. Working with Slides
- 24.5.1. Adding a Slide to a Presentation
- 24.5.2. Inserting Slides from an Existing Presentation
- 24.5.3. Finding a Slide by Its ID Number
- 24.5.4. Changing the Layout of an Existing Slide
- 24.5.5. Deleting an Existing Slide
- 24.5.6. Copying and Pasting a Slide
- 24.5.7. Duplicating a Slide
- 24.5.8. Moving a Slide
- 24.5.9. Accessing a Slide by Name
- 24.5.10. Working with a Range of Slides
- 24.5.11. Formatting a Slide
- 24.5.12. Setting a Transition for a Slide, a Range of Slides, or a Master
- 24.6. Working with Masters
- 24.7. The Bottom Line
-
25. Working with Shapes and Running Slide Shows
-
25.1. Working with Shapes
-
25.1.1. Adding Shapes to Slides
- 25.1.1.1. Shared Arguments for Adding Shapes
- 25.1.1.2. Type Argument for Adding Shapes
- 25.1.1.3. Arguments Specific to the AddTextEffect Method
- 25.1.1.4. Arguments Specific to the AddOLEObject Method
- 25.1.1.5. An Example of Using the AddShape Method
- 25.1.1.6. An Example of Using the AddTextEffect Method
- 25.1.1.7. An Example of Using the AddTextbox Method
- 25.1.2. Deleting a Shape
- 25.1.3. Selecting All Shapes
- 25.1.4. Repositioning and Resizing a Shape
- 25.1.5. Copying Formatting from One Shape to Another
- 25.1.6. Working with Text in a Shape
- 25.1.7. Setting an Animation for a Shape or a Range of Shapes
-
25.1.1. Adding Shapes to Slides
- 25.2. Working with Headers and Footers
-
25.3. Setting Up and Running a Slide Show
- 25.3.1. Controlling the Show Type
- 25.3.2. Creating a Custom Show
- 25.3.3. Deleting a Custom Show
- 25.3.4. Starting a Slide Show
- 25.3.5. Changing the Size and Position of the Slide Show
- 25.3.6. Moving from Slide to Slide
- 25.3.7. Pausing the Show and Using White and Black Screens
- 25.3.8. Starting and Stopping Custom Shows
- 25.3.9. Exiting the Slide Show
- 25.4. The Bottom Line
-
25.1. Working with Shapes
-
26. Understanding the Outlook Object Model and Key Objects
- 26.1. Getting an Overview of the Outlook Object Model
- 26.2. Working with the Application Object
- 26.3. Understanding General Methods for Working with Outlook Objects
- 26.4. Working with Messages
- 26.5. Working with Calendar Items
- 26.6. Working with Tasks and Task Requests
- 26.7. Searching for Items
- 26.8. The Bottom Line
-
27. Working with Events in Outlook
-
27.1. Working with Application-Level Events
- 27.1.1. Using the Startup Event
- 27.1.2. Using the Quit Event
- 27.1.3. Using the ItemSend Event
- 27.1.4. Using the NewMail and NewMailEx Events
- 27.1.5. Using the AdvancedSearchComplete and the AdvancedSearchStopped Events
- 27.1.6. Using the MAPILogonComplete Event
- 27.1.7. Using the Reminder Event
- 27.1.8. Using the OptionsPagesAdd Event
-
27.2. Working with Item-Level Events
- 27.2.1. Declaring an Object Variable and Initializing an Event
- 27.2.2. Understanding the Events That Apply to All Message Items
- 27.2.3. Understanding the Events That Apply to Explorers, Inspectors, and Views
- 27.2.4. Understanding the Events That Apply to Folders
- 27.2.5. Understanding the Events That Apply to Items and Results
- 27.2.6. Understanding the Events That Apply to the Outlook Bar
- 27.2.7. Understanding the Events That Apply to Reminders
- 27.2.8. Understanding the Events That Apply to Synchronization
- 27.3. Understanding Quick Steps
- 27.4. The Bottom Line
-
27.1. Working with Application-Level Events
-
28. Understanding the Access Object Model and Key Objects
-
28.1. Getting Started with VBA in Access
- 28.1.1. Creating a Module in the VBA Editor
- 28.1.2. Creating a Function
- 28.1.3. The Revamped Macro Builder
- 28.1.4. Creating an Access-Style Macro to Run a Function
- 28.1.5. Using an AutoExec Macro to Initialize an Access Session
- 28.1.6. Running a Subprocedure
- 28.1.7. Understanding the Option Compare Database Statement
- 28.2. Getting an Overview of the Access Object Model
- 28.3. Understanding Creatable Objects in Access
- 28.4. Opening and Closing Databases
- 28.5. Working with the Screen Object
- 28.6. Using the DoCmd Object to Run Access Commands
- 28.7. The Bottom Line
-
28.1. Getting Started with VBA in Access
-
29. Manipulating the Data in an Access Database via VBA
- 29.1. Understanding How to Proceed
- 29.2. Preparing to Manage the Data in a Database
- 29.3. Opening a Recordset
- 29.4. Accessing a Particular Record in a Recordset
- 29.5. Searching for a Record
- 29.6. Returning the Fields in a Record
- 29.7. Editing a Record
- 29.8. Inserting and Deleting Records
- 29.9. Closing a Recordset
- 29.10. The Bottom Line
-
30. Accessing One Application from Another Application
- 30.1. Understanding the Tools Used to Communicate Between Applications
- 30.2. Using Automation to Transfer Information
- 30.3. Using the Shell Function to Run an Application
-
30.4. Using Data Objects to Store and Retrieve Information
- 30.4.1. Creating a Data Object
- 30.4.2. Storing Information in a Data Object
- 30.4.3. Returning Information from a Data Object
- 30.4.4. Assigning Information to the Clipboard
- 30.4.5. Returning Information from the Clipboard to a Data Object
- 30.4.6. Finding Out Whether a Data Object Contains a Given Format
-
30.5. Communicating via DDE
- 30.5.1. Using DDEInitiate to Start a DDE Connection
- 30.5.2. Using DDERequest to Return Text from Another Application
- 30.5.3. Using DDEPoke to Send Text to Another Application
- 30.5.4. Using DDEExecute to Execute a Command in Another Application
- 30.5.5. Using DDETerminate to Close a DDE Channel
- 30.5.6. Using DDETerminateAll to Close All Open DDE Channels
- 30.6. Communicating via SendKeys
- 30.7. The Bottom Line
-
31. Programming the Office 2010 Ribbon
- 31.1. Hiding the Editing Group on the Word Ribbon
- 31.2. Working with Excel and PowerPoint
- 31.3. Undoing Ribbon Modifications
- 31.4. Selecting the Scope of Your Ribbon Customization
- 31.5. Adding a New Group
- 31.6. Adding Callbacks
- 31.7. Adding Attributes
- 31.8. Using Menus and Lists
- 31.9. Toggling with a Toggle Button Control
- 31.10. Modifying the Ribbon in Access
- 31.11. Adding a Callback in Access
- 31.12. What to Look For If Things Go Wrong
- 31.13. Where to Go from Here
- 31.14. The Bottom Line
-
20. Understanding the Word Object Model and Key Objects
-
A. The Bottom Line
- A.1. Chapter 1: Recording and Running Macros in the Office Applications
- A.2. Chapter 2: Getting Started with the Visual Basic Editor
- A.3. Chapter 3: Editing Recorded Macros
- A.4. Chapter 4: Creating Code from Scratch in the Visual Basic Editor
- A.5. Chapter 5: Understanding the Essentials of VBA Syntax
- A.6. Chapter 6: Working with Variables, Constants, and Enumerations
- A.7. Chapter 7: Using Array Variables
- A.8. Chapter 8: Finding the Objects, Methods, and Properties You Need
- A.9. Chapter 9: Using Built-in Functions
- A.10. Chapter 10: Creating Your Own Functions
- A.11. Chapter 11: Making Decisions in Your Code
- A.12. Chapter 12: Using Loops to Repeat Actions
- A.13. Chapter 13: Getting User Input with Message Boxes and Input Boxes
- A.14. Chapter 14: Creating Simple Custom Dialog Boxes
- A.15. Chapter 15: Creating Complex Dialog Boxes
- A.16. Chapter 16: Building Modular Code and Using Classes
- A.17. Chapter 17: Debugging Your Code and Handling Errors
- A.18. Chapter 18: Building Well-Behaved Code
- A.19. Chapter 19: Securing Your Code with VBA's Security Features
- A.20. Chapter 20: Understanding the Word Object Model and Key Objects
- A.21. Chapter 21: Working with Widely Used Objects in Word
- A.22. Chapter 22: Understanding the Excel Object Model and Key Objects
- A.23. Chapter 23: Working with Widely Used Objects in Excel
- A.24. Chapter 24: Understanding the PowerPoint Object Model and Key Objects
- A.25. Chapter 25: Working with Shapes and Running Slide Shows
- A.26. Chapter 26: Understanding the Outlook Object Model and Key Objects
- A.27. Chapter 27: Working with Events in Outlook
- A.28. Chapter 28: Understanding the Access Object Model and Key Objects
- A.29. Chapter 29: Manipulating the Data in an Access Database via VBA
- A.30. Chapter 30: Accessing One Application from Another Application
- A.31. Chapter 31: Programming the Office 2010 Ribbon
Product information
- Title: Mastering VBA for Microsoft® Office 2010
- Author(s):
- Release date: August 2010
- Publisher(s): Sybex
- ISBN: 9780470634004
You might also like
book
Mastering VBA for Microsoft Office 2007, 2nd Edition
Even if you're not a programmer, you can quickly learn to write macros, automate tasks, and …
book
Mastering VBA for Microsoft Office 2013
A unique, comprehensive guide to creating custom apps with VBA Automating computing tasks to increase productivity …
book
Beginning Access™ 2007 VBA
This book provides you with the tools and techniques you'll need in order to build more …
book
Access™ 2007 VBA Bible: For Data-Centric Microsoft® Office Applications
Learn how to tap the full potential of Access 2007 Transfer Access data seamlessly between Microsoft …