Gordon McComb
Automation

Field Guide to Books on Writing Microsoft Word Macros

Word and Microsoft Office VBA Macros

Here's my take on the Word macro books available today. For your convenience, suggested books include a link to Amazon. Clicking the link opens a new browser window, where you can read more about the book.

Books on Word VBA (and VBA in general)

Since I created this list a few years back, some of the books mentioned here have gone out of print, or have been replaced by updated versions. Out-of-print books are often still available.

The books that follow describe writing automation solutions (i.e. macros) using Visual Basic for Applications. Some are specific to Microsoft Word, while others discuss VBA as a programming platform. These latter books usually contain at least one chapter on automating Word tasks. They are particularly handy if you need to interoperate between several Word applications, such as Outlook and Word, or Word and Excel.

Mastering VBA for Microsoft Office 2016 3rd Edition (not yet reviewed)
Mastering VBA for Microsoft Office 2013 (not yet reviewed)
Mastering VBA for Office 2010 (not yet reviewed)
Word 2007 Macros & VBA Made Easy (not yet reviewed)

Mastering Microsoft VBA (Second Edition)
Guy Hart-Davis - Sybex, 2005
This a good book for those just starting out, as well as those with some experience in VBA to learn (or re-learn) the finer points of the process. If you already know something about writing VBA macros, you may wish to skim the first few introductory chapters, and go right to the middle of the book.

The bulk of Mastering Microsoft VBA covers general-purpose VBA, and it's not until page 441 until we get into the "Applications" part of VBA. The author provides several Word-specific chapters, mostly covering general topics such as inserting text and creating tables. Other application-specific chapters cover Excel, PowerPoint, Access, and Outlook.

Word 2003 Document Automation with VBA, XML, XSLT, and Smart Documents
Scott Driza - Wordware Publishing, Inc., 2005
This book focusses on leveraging VBA with other modern technologies to develop document automation solutions. There is quite a bit of introductory and intermediate information on using VBA, but a good deal of the book is on extending VBA's natural abilities using XML and XSLT. Author Driza makes no assumptions as to your familiarity with XML, and explains the basic concepts and advantages. He also details XSLT and style sheets, and it is used to transform XML files into formatted human-readable documents.

Microsoft Office Programming: A Guide for Experienced Developers
Rod Stephens - Apress, 2003
Author Stephens likes to write books aimed at the more seasoned professional, and this one is no exception. Microsoft Office Programming is intended for the reader already familiar with the basic concepts of VBA in Word and other Office applications. Still, there's plenty of what I'd call introductory instruction here, like customizing keyboards and menus. The coverage of Word is adequate, though obviously I like to see more emphasis on Word than what is usually found in these grab-bag VBA books. This edition was written for Office XP (Office 2002), and there's a chapter on Office 2003 that discusses differences, and a chapter on Smart Tags.

VBA Developer's Handbook, 2nd Edition
Getz, Gilbert - Sybex, 2001
A little old in the tooth but still valid, this is a book for the intermediate and advanced user. Authors Getz and Gilbert have obviously put a lot of time and effort into this book, which includes copious amounts of example code. Some of the content of VBA Developer's Handbook is pure esoterica. For example, only a handful of VBA developers will ever have a need to access non-client metrics (window settings like border width or icon size). Still, if that's your bag, it's a good example of the level of detail found in this book.

VB and VBA in a Nutshell: The Languages
Paul Lomax - O'Reilly Media, 1998
Though over 10 years old, this somewhat dry but authoritative edition is still relevant today. It is comprised chiefly of an alphabetical list of VB/VBA statements, complete with syntax, notes, and short examples. This book dwells on the programming language shared by Visual Basic and VBA (after a valiant attempt, it fails to fully explain the differences). It's important to note that VB and VBA in a Nutshell lacks information on using VBA for any given application, like Word and Excel.

Honorary Mentions

Office VBA Macros You Can Use Today: Over 100 Amazing Ways to Automate Word, Excel, PowerPoint, Outlook, and Access
Gonzalez, et al - Holy Macro! Books, 2006

Absolute Beginner's Guide to VBA
Paul McFedries - Que, 2004

"

Books on Office .NET Development and Visual Studio Tools for Office

Most independent and in-house programmers continue to use VBA for automating Word (and other Office) tasks. Ever willing to add yet another technology to the plate, Microsoft offers Visual Studio Tools for Office (VSTO), a set of add-on tools for the Visual Studio .NET 2003 and Visual Studio 2005 programming platforms. These tools offer easier integration with Office products when using Visual Studio.

Note that Visual Studio provides a choice of programming languages, among them Visual Basic, Visual C# (A C-like language with certain modifications), Visual J# (similar to Java) and Visual C++ -- and in that order of increasing difficulty of learning. All of the books that follow are written for either Visual Basic or C#, and a a couple provide example code in both.

A few of the books detail integrating .NET and Office without VSTO, useful if you're working with versions of Word/Office that do not support VSTO.

Word 2007 Document Automation with VBA and VSTO
Driza - Jones-Bartlett, 2009
Another big book by author Scott Driza, this version of his document automation book concentrates on VBA and VSTO for Word 2007 and later. Unlike VSTO-specific books, this one also covers automation from the more common VBA perspective, which is useful if you want to compare approaches to see which one is better for a given application.

Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath
Carter, Lippert - Addison-Wesley, 2005
This is a hefty tome (over 1,000 pages) that is sure to be one of the leading titles in VSTO programming. True to its title, the book breaks up its Office coverage with separate chapters develoted to Excel, Word, Outlook, and Infopath -- the latter a technology bridge to develop XML-based data entry forms.

The same authors offer an Office 2007-specific version of the book as well.

Microsoft .NET Development for Microsoft Office
Andrew Whitechapel - Microsoft Press, 2004
This is Microsoft's sponsored book on leveraging Visual Studio development with Microsoft Office, without using VSTO. The techniques covered in this book are relevent when integrating with earlier versions of Office that do not support VSTO, or if you don't wish to use VSTO because of its cost.

Honorary Mentions

VSTO for Mere Mortals: A VBA Developer's Guide to Microsoft Office Development Using Visual Studio 2005 Tools for Office
McGrath, Stubbs - Addison-Wesley, 2006

Professional VSTO 2005: Visual Studio 2005 Tools for Office
Alvin Bruney - Wrox, 2006

Books on Using XML In Office

Automation does not strictly require traditional programming. With XML and XSLT, for example, it's possible to produce the content of documents, and format them in a variety of ways, with little or no programming code. The following books deal with adapting XML strategies in Word and other Microsoft Office applications.

Office 2003 XML
St. Laurent, Lenz, McRae - O'Reilly Media, 2003

Office 2003 XML for Power Users
McDonald - APress, 2004