18. Automating Word

Word, Excel, PowerPoint, Outlook, and Access all use the same VBA language. The only difference is their object models. For example, Excel has a Workbooks object and Word has Documents. Any one of these applications can access another application’s object model as long as the second application is installed.

To access Word’s object library, Excel must establish a link to it by using either early binding or late binding. With early binding, the reference to the application object is created when the program is compiled. With late binding, the reference is created ...

Get VBA and Macros: Microsoft® Excel® 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.