Visual FoxPro developers are used to building large, complex applications using only VFP as their programming environment. But Windows users are demanding more—integration with other applications such as the Microsoft Office suit—Word, Excel, PowerPoint and Outlook. Visual FoxPro can be used to automate—either visually or behind the scenes—any task or process that you could do manually in Office, plus much more. In
, users learn how to create powerful applications that span the entire Office suite, using Visual FoxPro in the driver’s seat.
This book grew out of another book. In 1995, when FoxPro grew into Visual FoxPro, Tamar, together with Ted Roche, the technical editor of this book, wrote a book called Hacker’s Guide to Visual FoxPro 3.0 (Addison-Wesley). The bulk of that book, nearly 700 of its 900-some pages, was an alphabetic reference to every command, function, property, event, method, and system variable in Visual FoxPro. Oddly enough, Tamar and Ted didn’t just sit down and create a single Word document starting from "A" and working their way through to "Z." In fact, about 600 documents went into that section of the book.
When the writing was done and the smoke cleared, Ted had a brilliant idea. (Actually, he had the idea well before the writing was done.) VFP 3 was the first version of the product to support Automation. He wrote some code to take those 600 documents and put them together in the right order to create the reference section of the Hacker’s Guide.
In 1998, Tamar and Ted were at it again with an updated and expanded version called Hacker’s Guide to Visual FoxPro 6.0 (Hentzenwerke). This time, Tamar took on the task of assembling the book while Ted used Automation to turn the whole thing into an HTML Help file. With the new material from VFP 5 and 6, there weren’t 600 documents involved; there were more than 800.
In addition, changes in the way the book was managed meant that, before producing the final version, a lot of clean-up work had to be done. For example, Microsoft had changed the name of the product during the beta process. (Visual FoxPro 98 became Visual FoxPro 6.) The copy editor had done a wonderful job of finding inconsistencies in terminology, catching things like "textbox" vs. "text box," but some sections edited early in the process needed to be corrected. The biggest issue of all came very late in the game when a decision was made to make the book 8.5" x 11" instead of 7" x 9"—this meant that margins had to be changed, tables had to be resized, and many other changes were needed to every one of those 800+ documents.
Handling all of these changes by hand would have taken months and the book would have been hopelessly late. Automation to the rescue. Tamar wrote VFP code to open each document in Word, do the necessary processing, and save it as a new document. After all the processing was done, an updated version of Ted’s original assembly code created the reference section.
Along the way, while falling in love with Automation, Tamar beat her head against the wall regularly. Brute force was the order of the day. The Word documentation was helpful, as were the people on CompuServe’s MSWord forum. But nowhere was there a real resource for someone writing Automation code like this, especially someone writing it from Visual FoxPro.