Using a script to create a text file is fairly easy because the Windows environment in general and the Windows Script Host (WSH) environment in particular provide ad hoc tools for working with text files. However, although text files are ideal for storing simple, unstructured information, they're inadequate when your requirements are more sophisticated. If you need to present hierarchical information, you can rely on XML and create tagged text with or without referencing a schema. Frequently, though, what you'd like to be able to do is create documents that present informative content in a complex layout. HTML files are one alternative for marrying content and sophisticated layout. However, HTML documents are plain text and, as such, are subject to tampering. Furthermore, HTML documents are rarely self-contained, often linking to external resources such as images, ActiveX controls, and applets.
In contrast, Microsoft Word is a de facto standard for real-world document exchange. Creating such documents interactively is easy, but can you automate that process by creating and programmatically using template-based documents? The answer is certainly yes, as I explain. I don't go into detail about the Word end of the process; rather, I concentrate on creating and manipulating Word documents programmatically and assume that you know the basics of Word templates and bookmarks. . . .