Mitech Preloader

Mark up a Document to be a Template

Authoring Templates / Cookbook / Help

Mark up a Document to be a Template

The first serious template that you will want to create will probably be based on a document that you already have, and which has the names, addresses, contact details, etc. of parties in it.

Suppose you have a lease agreement which is between a tenant and a landlord, and the names and addresses of the parties, as well as dates of the lease and all other information has been completed.  Here is a snapshot of the first few paragraphs of a typical lease:


A quick glance at this document snippet shows that there are quite a few items which will change from one lease to another: the name (ABC Homes) and address of the landlord, the name (John Smith) and email address of the tenant, the apartment number and address, the dates of the lease.

This highlights some important issues, the first being that there are a fairly large number of items in just half a page of document, meaning that the traditional way of preparing this kind of document – i.e. take an existing document and replace all the existing items with the new ones – is vulnerable to error: it is so easy to miss out just one of the important pieces of information. This in turn highlights the need for a tool like Xpressdox to be able to produce even relatively simple documents correctly every time.

Now to the process of marking up this document. First an overview: this is really a straight forward process. It consists of

  • finding an item in the document which changes from one document to the next (e.g. the string “ABC Homes”) and deciding on a name for it (e.g. “Landlord”). This name is the XpressDox data element name for the landlord.
  • using find-and-replace to find all instances of “ABC Homes” and replacing it with «Landlord».

It should be possible to use the MS Word Find-and-Replace tool to perform the second step above.  There is a problem  though, and that is that the MS Word find-and-replace does not allow you to type the XpressDox fillpoint chevron delimiters (« and ») into the find or replace text areas (you have to type ^0171 and ^0187, and even then it sometimes translates the chevron as a quote ” – totally unworkable in this context).  For this reason, XpressDox implements its own Find-and-Replace especially for the purpose of marking up a template from an existing document.  This is found in the Utilities feature:



Here’s how to use the Utilities button in order to mark up the document that we want as a template:

  1. In the document, select the phrase “ABC Homes”.
  2. Click on the Utilities button on the ribbon (as in the screen shot above).  The following dialog form is displayed:
  3. Press <Ctrl F> (or click on the Find and Replace tab on the above dialog) and notice that the XpressDox Find-and-Replace dialog shows with the selected text already in the Find area:
  4. Now in the “Replace with” area just type the data element name, in this case Landlord. Notice that the fillpoint delimiters are supplied automatically around the data element name.
  5. Press the “Replace All” button, and the document will look like this:
  6. Notice how the text “ABC Homes” has been replaced in the two places that it occurred in the document snippet that we are dealing with (in the full document there were 13 occurrences of this – which illustrates again how useful the document assembly approach is).
  7. Now go on to the next item on the document, which is the landlord’s address.  Select it in the document, and then click in the “Find what” area in the XpressDox Find and Replace dialog – the dialog will still be open if you didn’t close it.  Notice that the “Find what” area is filled automatically with what you selected in the document.
  8. Type “LandlordAddress” in the “Replace with” area, and press the “Replace All” button.
  9. Continue with all the other items which need to change for every new lease.
  10. Once you have completed all the variable items in the document and replaced them all with XpressDox fillpoints, save the document as a template and it is ready to be run.

Some things to bear in mind:

  • If there were some occurrences of the string “ABC HOMES” (i.e. all in uppercase), then you would type “ABC HOMES” in the “Find what” area, and “ToUpper(Landlord)” in the “Replace with” area.
  • There might be cases where, for instance, you would want to capture the landlord name from a list of landlords for whom you act.  You would then want to replace “ABC Homes” with something like “«ChooseFromList(Landlord,ABC Homes,DEF Properties,HIJ Apartments)»«Landlord»”.  In this case, typing the Choose… command in the Replace area would result in that Choose… being enclosed in chevrons – then press the “Insert « and »” button to insert a pair of chevrons at the end of the Replace area, and you can then type “Landlord” inside those two delimiters.
  • The chevrons are the default fillpoint delimiters for XpressDox since Version 4.  But you are able to choose your own fillpoint delimiters. If you have chosen other delimiters for your fillpoints, the XpressDox Find and Replace utility will use those delimiters in its operation.