CONTENTS
Introduction
Chapter 1: Manipulating
Strings
How Does VBA Store
Strings? Unicode versus ANSI Using Built-In String Functions Putting the Functions Together Searching for and Replacing Text Gathering Information about Strings Converting Strings Working with Substrings
Chapter 2: Working with Numbers
How Does VBA Store Numeric
Values? Using Built-In Numeric Functions Custom Math and Numeric Functions
Chapter 3: Working with Dates and Times
What Is a Date, and How Did
It Get There? The Built-In VBA Date Functions Odd Behaviors Displaying Values the Way You Want Beyond the Basics Finding a Specific Date Finding the Next Anniversary Finding the nth Particular Weekday in a Month Working with Workdays Manipulating Dates and Times Working with Elapsed Time Handling Time Zone Differences
Chapter 4: Using VBA to Automate Other Applications
Automation Basics Creating Object Instances Controlling Other Applications Creating Automation Solutions with Microsoft Office Example: Word as a Report Writer Example: Populating an Excel Worksheet Tapping into Events Using WithEvents
Chapter 5: Creating Your Own Objects with VB Class
Modules
Why Use Class Modules? How Class Modules Work A Simple Example: A Text File Class Using Property Procedures Creating Enumerated Types Applying Class Module Techniques to the Windows API
Chapter 6: Advanced Class Module Techniques
Object Model Design
Principles Developing Object Hierarchies Collections of Objects Creating and Using Custom Events Interface Classes and the Implements Keyword Other Advanced Considerations
Chapter 7: Searching and Sorting in VBA
Timing Is Everything Using Arrays Sorting Arrays Searching
Chapter 8: Creating Dynamic Data Structures Using Class
Modules
Dynamic versus Static Data
Structures How Does This Apply to VBA? Creating a Stack Creating a Queue Creating Ordered Linked Lists Creating Binary Trees The Tree Class Adding a New Item Adding a New Node: Walking the Code Traversing the Tree Traversing a Tree: Walking the Code The Sample Project What Didn't We Cover?
Chapter 9: Retrieving and Setting System Information
VBA and System
Information The API Functions Computer and Operating System Information Keyboard Information Memory Status Mouse Information Non-Client Metrics Power Status Screen and Window Information System Colors
Chapter 10: Managing Windows Registry Data
Registry Structure VBA Registry Functions Windows Registry Functions An Object Model for the Registry
Chapter 11: The Windows Networking API
Basic Network
Functionality Advanced Networking Functionality
Chapter 12: Working with Disks and Files
The Built-In VBA Disk and
File Functions File I/O If You Must The Windows API: Where the Real Power Is Using the Windows Common File Dialogs
Chapter 13: Adding Multimedia to Your Applications
An Introduction to Windows
Multimedia One-Step Multimedia Understanding the Media Control Interface Putting MCI to Work
Chapter 14: Using the Scripting Runtime Library
Objects
Why Is This Chapter
Different? Testing the Simple FileSystemObject Methods Copying and Moving Files and Folders The Drives Collection The Drive Object The Folder Object The Files Collection The File Object The TextStream Object Working with the Dictionary Object
Chapter 15: Writing Add-Ins for the Visual Basic IDE
Working with the IDE Object
Model Putting It Together: An Alternative Object Model COM Add-Ins Building a COM Add-In for the VBA IDE
Appendix A: The Reddick VBA Naming Conventions, Version
6
Changes to the
Conventions An Introduction to Hungarian
Index |