Tuesday, August 19, 2008

Macro-Enabled Template: Step 1 - Preparing The Document

This is step one in the series showing you how to create macro-enabled templates.  For the finished product see the freebie file in this previous post.

First we need to open the file that we want to make a template of.  For this preview I've chosen just a simple blank caption. Use one of your own in making this template.  Notice in the image below that there are no blank spaces where information will be filled in, for example instead of a blank space we have COUNTYNAME, you will find shortly that this is for an important reason.

Next we are going to change a setting in office to display bookmarks.  Unless you're already a Word power user you've likely not run into a whole lot of bookmarks, nor does the average person, thus the reason they are hidden by default.

 In Office 2007 click on the Office Button, then click Word Options at the bottom of the pop up.  Next click on the Advanced tab (reading this blog qualifies you as an advanced user, pat yourself on the back),  scroll down about one-third of the way until you see the 'show document content' heading. Click OK.
In Office 2003 click Tools>Options>View and check the bookmarks box. 

Now we go through the process of inserting bookmarks.  The template will replace the bookmark contents with the values we enter into the form, so we need to insert a bookmark anyplace the information will be changed.  A couple of things to know about bookmarks before we hit it. First, bookmarks names cannot have spaces. Next, multiple bookmarks cannot have the same name, so we'll use numbers at the end of each bookmark to avoid duplicity. 

So lets go to it then.  Start by highlighting COUNTYNAME, or your variation of it and click Insert>Bookmark.  Name the bookmark countyname1.  I prefer to use all lowercase for my bookmark names, it's not a requirement though.  Continue this process for each field: circuitnumber, pfirstname, plastname, dfirstname, dlastname, casecode, casenumber, documenttitle, and any other you may have.  Be sure to not use spaces and to add sequential numbers to the end for each bookmark name.  In the template I used I didn't have any bookmarks duplicated on page one and so all those ended with 1.

Once you're finished with that... guess what.  You're document is prepared, mostly.  One final tip that I want you to do is highlight everything that you want to keep highlighted and hit CTRL+SHIFT+A.  This will force the text that we enter in the form to be all caps even if we don't type it as such.

So that's step one of this guide broken down into nice digestible parts.  I'll post the next entry on Monday.


Post a Comment