Home Page Icon
Home Page
Table of Contents for
G
Close
G
by Richard Mansfield
Mastering VBA for Microsoft Office 2007, 2nd Edition
Copyright
Dear Reader
Dedication
Acknowledgments
About the Author
Introduction
Recording Macros and Getting Started with VBA
Recording and Running Macros in the Microsoft Office Applications
What Is VBA and What Can You Do With It?
Understanding Macro Basics
Recording a Macro
Running A Macro
Recording a Sample Word Macro
Recording A Sample Excel Macro
Assigning A Way Of Running The Macro
Deleting a Macro
The Bottom Line
Getting Started with the Visual Basic Editor
Opening The Visual Basic Editor
Using The Visual Basic Editor's Main Windows
Setting Properties For A Project
Customizing The Visual Basic Editor
Closing The Visual Basic Editor And Returning To The Host Application
The Bottom Line
Editing Recorded Macros
Testing a Macro in the Visual Basic Editor
Editing the Word Macro
Editing The Excel Macro
Editing a Powerpoint Macro
The Bottom Line
Creating Code from Scratch in the Visual Basic Editor
Setting Up The Visual Basic Editor For Creating The Procedures
Creating a Proedure for Word
Creating A Procedure For Excel
Creating a Procedure for Powerpoint
Creating a Procedure for Access
The Bottom Line
Learning How to Work With VBA
Understanding the Essentials of VBA Syntax
Getting Ready
Procedures
Statements
Keywords
Expressions
Operators
Variables
Constants
Arguments
Objects
Collections
Properties
Methods
Events
The Bottom Line
Working with Variables, Constants, and Enumerations
Working With Variables
Working with Constants
Working with Enumerations
The Bottom Line
Using Array Variables
What Is an Array?
Declaring an Array
Storing Values In An Array
Multidimensional Arrays
Declaring a Dynamic Array
Redimensioning an Array
Returning Information from an Array
Erasing an Array
Finding Out Whether a Variable Is an Array
Finding the Bounds of an Array
Sorting an Array
Searching Through an Array
The Bottom Line
Finding the Objects, Methods, and Properties You Need
What Is an Object?
Working with Collections
Finding the Objects You Need
Using object Variables to Represent objects
The Bottom Line
Making Decisions and Using Loops and Functions
Using Functions
what Is a Function?
Using Functions
Using Functions to Convert Data from One Type to Another
Using Functions to Manipulate Strings
Using VBA's Mathematical Functions
Using VBA's Date and Time Functions
Using File-Management Functions
The Bottom Line
Creating Your Own Functions
Components of a Function
Creating a Function
Examples of Functions for Any VBA-Enabled Application
Creating a Function for Word
Creating a Function for Excel
Creating a Function for Powerpoint
Creating a Function for Access
The Bottom Line
Making Decisions in Your Code
How Do You Compare Things in VBA?
Testing Multiple Conditions by Using Logical Operators
If Statements
Select Case Statements
The Bottom Line
Using Loops to Repeat Actions
When Should You Use a Loop?
Understanding the Basics of Loops
Using For... Loops for Fixed Repetitions
Using Do... Loops for Variable Numbers of Repetitions
While... Wend Loops
Nesting Loops
Avoiding Infinite Loops
The Bottom Line
Using Message Boxes, Input Boxes, and Dialog Boxes
Getting User Input with Message Boxes and Input Boxes
Opening a Procedure to Work on
Displaying Status Bar Messages in Word and Excel
Message Boxes
Input Boxes
Forms: When Message Boxes and Input Boxes Won't Suffice
The Bottom Line
Creating Simple Custom Dialog Boxes
When Should You Use a Custom Dialog Box?
Creating a Custom Dialog Box
Linking a Dialog Box to a Procedure
Retrieving the User's Choices from a Dialog Box
Examples of Connecting Dialog Boxes to Procedures
Using an Application's Built-in Dialog Boxes from VBA
The Bottom Line
Creating Complex Dialog Boxes
Creating and Working with Complex Dialog Boxes
Using Events to Control Forms
The Bottom Line
Creating Effective Code
Building Modular Code and Using Classes
Creating Modular Code
Creating And Using Classes
The Bottom Line
Debugging Your Code and Handling Errors
Principles of Debugging
The Different Types of Errors
VBA'S Debugging Tools
Dealing With Infinite Loops
Dealing With Runtime Errors
Suppressing Alerts
Handling User Interrupts in Word, Excel, and Project
Documenting Your Code
The Bottom Line
Building Well-Behaved Code
What Is a Well-Behaved Procedure?
Retaining or Restoring the User Environment
Leaving The User in The Best Position to Continue Working
Keeping the User Informed During The Procedure
Making Sure the Procedure Is Running Under Suitable Conditions
Cleaning Up after a Procedure
The Bottom Line
Securing Your Code with VBA's Security Features
Understanding How VBA Implements Security
Signing Your Macro Projects With Digital Signatures
Choosing a Suitable Level of Security
Locking Your Code
The Bottom Line
Programming the Office Applications
Understanding the Word Object Model and Key Objects
Examining the Word Object Model
Working with the Documents Collection and the Document Object
Working with the Selection Object
Creating and Using Ranges
Manipulating Options
The Bottom Line
Working with Widely Used Objects in Word
Using Find and Replace via VBA
Working with Headers, Footers, and Page Numbers
Working with Sections, Page Setup, Windows, and Views
Working with Tables
The Bottom Line
Understanding the Excel Object Model and Key Objects
Getting an Overview of the Excel Object Model
Understanding Excel'S Creatable Objects
Working with Workbooks
Working with Worksheets
Working with the Active Cell or Selection
Working with Ranges
Setting Options
The Bottom Line
Working with Widely Used Objects in Excel
Working with Charts
Working with Windows
Working with Find and Replace
Adding Shapes
The Bottom Line
Understanding the PowerPoint Object Model and Key Objects
Getting an Overview of the Powerpoint Object Model
Understanding Powerpoint'S Creatable Objects
WOrking With Presentations
WOrking with Windows and Views
WOrking With Slides
WOrking With Masters
The Bottom Line
Working with Shapes and Running SLide Shows
WOrking With Shapes
WOrking with Headers and Footers
Setting Up and Running a Slide Show
The Bottom Line
Understanding the Outlook Object Model and Key Objects
Getting an Overview of the Outlook Object Model
Working with the Application Object
Understanding General Methods for Working with Outlook Objects
Working with Messages
WOrking with Calendar Items
Working with Tasks and Task Requests
Searching for Items
The Bottom Line
Working with Events in Outlook
WOrking with Application-Level Events
WOrking with Item-Level Events
The Bottom Line
Understanding the Access Object Model and Key Objects
Getting Started with VBA in Access
Getting an Overview of the Access Object Model
Understanding Creatable Objects in Access
Opening and Closing Databases
Working with the Screen Object
Using the Docmd Object to Run Access Commands
The Bottom Line
Manipulating the Data in an Access Database via VBA
Understanding How to Proceed
Preparing to Access the Data in the Database
Opening a Recordset
Accessing a Particular Record in a Recordset
Searching for a Record
Returning the Fields in a Record
Editing a Record
Inserting and Deleting Records
Closing a Recordset
The Bottom Line
Accessing One Application from Another Application
Understanding the Tools for Communicating with Other Applications
Using Automation to Transfer Information
Using the Shell Function to Run an Application
Using Data Objects to Store and Retrieve Information
Communicating via DDE
Communicating via SendKeys
The Bottom Line
Programming the Office 2007 Ribbon
Hiding the Editing Group on the Word Ribbon
Working with Excel and PowerPoint
Undoing Ribbon Modifications
Selecting the Scope of Your Ribbon Customization
Adding a New Group
Adding Callbacks
Adding Attributes
Using Menus and Lists
Toggling with a Toggle Button Control
Modifying the Ribbon in Access
Adding a Callback in Access
What to Look For if Things Go Wrong
Where to Go from Here
The Bottom Line
The Bottom Line Solutions
Chapter 1: Recording and Running Macros in theMicrosoft Office Applications
Chapter 2: Getting Started with the Visual Basic Editor
Chapter 3: Editing Recorded Macros
Chapter 4: Creating Code from Scratch in the Visual Basic Editor
Chapter 5: Understanding the Essentials of VBA Syntax
Chapter 6:Working with Variables, Constants, and Enumerations
Chapter 7: Using ArrayVariables
Chapter 8: Finding theObjects,Methods, and Properties YouNeed
Chapter 9: Using Functions
Chapter 10: Creating Your Own Functions
Chapter 11: Making Decisions in Your Code
Chapter 12: Using Loops to Repeat Actions
Chapter 13: Getting User Input with Message Boxes and Input Boxes
Chapter 14: Creating Simple Custom Dialog Boxes
Chapter 15: Creating Complex Dialog Boxes
Chapter 16: Building Modular Code and Using Classes
Chapter 17: Debugging Your Code and Handling Errors
Chapter 18: Building Well-Behaved Code
Chapter 19: Securing Your Code with VBA's Security Features
Chapter 20: Understanding the Word Object Model and Key Objects
Chapter 21: Working with Widely Used Objects in Word
Chapter 22: Understanding the Excel Object Model and Key Objects
Chapter 23: Working with Widely Used Objects in Excel
Chapter 24: Understanding the Powerpoint Object Model and Key Objects
Chapter 25: Working with Shapes and Running Slide Shows
Chapter 26: Understanding the Outlook Object Model and Key Objects
Chapter 27: Working with Events in Outlook
Chapter 28: Understanding the Access Object Model and Key Objects
Chapter 29: Manipulating the Data in an Access Database via VBA
Chapter 30: Accessing One Application from Another Application
Chapter 31: Programming the Office 2007 Ribbon
Glossary
A
B
C
D
E
F
G
H
I
K
L
M
O
P
R
S
T
U
V
W
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
F
Next
Next Chapter
H
G
get
To
return
the current value of a
property
.
group box
Another term for a frame control.
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset