Free Sample Letter Template with Dialog

This template sample is a simple example of how to code a front-end user dialog to obtain information from the user and then write that information into the newly created letter document. The code works for Word 97 onwards.

This example is coded to create a letter but it can easily be extended to front-end all manner of documents.

The dialog looks like this:

Free Sample Letter Template Dialog


Download the (zipped) template and store it in your User Templates directory. To find out what this is, in Word do Tools Options FileLocations and look under User templates to see what this directory is set to (if you cannot see the whole path press the Modify button). Usually either:

     C:\Program Files\Microsoft Office\Office\Templates

or the user profile area:

     C:\Documents and Settings\<username>\Application Data\Microsoft\Templates

 

Download the (zipped) template Letdem.dot

 

Try running the template by doing File New based on Letdem template.

Having created a letter using the template, do Tools Visual Basic Editor and look for the form called frmLetter in template Letdem.dot. Edit the code behind the form and start to understand and modify it to your requirements.