Word Templates

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Microsoft® Word is ideal for creating custom word-processing applications. You can take advantage of the power of Word to create nicely formatted invoicing, reporting, form letter applications, and so on.

Every Word document has an associated Microsoft® Visual Basic® for Applications (VBA) project. However, code you write in one document is not available easily to other documents. If you are creating an application in Word, it makes sense to create a custom document template and distribute that template to your users. That way, a number of different documents can call the code in the template. The same holds true for custom styles, toolbars, and recorded macros.

To further illustrate the advantages of packaging code in a template, consider the New event for a Word Document object. This event occurs when you create a new document from a template. The Document_New event procedure itself must reside in the template project; there is no reason to use it in a regular Word document (.doc file), because you cannot create a new document from another document.

See also

Creating Templates | The Normal Template | Custom Document Templates | Word Document Templates vs. Word Add-ins (Global Templates) | Excel Templates | PowerPoint Templates | Access Templates