A mail merge template is a Microsoft® Word® document set up for merging InterAction contacts and installed on the Application Server. You can edit the out-of-the-box templates and create new templates if necessary.
If you want to create or change the mail merge templates, it is helpful to understand how to set up a mail merge in Word. For detailed information about this topic, see the online Help for Word.
The templates you create for the InterAction Web Client are basically the same as the main document in a normal Microsoft Word mail merge.
See the following topics:
- Create a New Mail Merge Template for the Web Client
- Restore the Document to a Normal Word Document
- Set the Merge Type for a Document
- Edit a Mail Merge Template for the Web Client
- InterAction Fields for Mail Merge Templates
- Using Language-Specific Fields in the Mail Merge Template
- Ensuring that Changes to Your Templates are Available Immediately
- Suppressing the Company Name for Home Addresses
Create a New Mail Merge Template for the Web Client
The best way to create a new mail merge template is to perform a mail merge from the Web Client and then modify the template. This gives you access to all the possible merge fields for InterAction data.
You must have access to save files on the Application Server machine to create new templates.
- In the Web Client, select a contact from any contact list and choose Actions > Create Letters, Envelopes, or Labels.
- Choose an existing template similar to the type of template you want to create. For example, if you want to create a template for form letters, start with the out-of-the-box Letter template.
-
If you want to include language-specific fields in the merge template, select the Include Language-Specific information for the selected language check box and then select a language from the drop-down list.
This option is available if your organization has configured InterAction for International Correspondence.
See InterAction Fields for Mail Merge Templates for more details.
-
Choose OK to launch the merge.
The Web Client will export the selected contact to a file and then Word will start, open the selected template and perform the merge.
- After the merge, there should be two open Word documents – the main document and the merged document. You can close the merged document.
-
Save a copy of the main document with a new name, then customize the document as needed. You can add static text or merge fields for InterAction data.
The Mail Merge toolbar in Microsoft Word includes buttons for adding merge fields. When you choose to add fields, Word looks at the data exported in step 2. For a list of possible fields to use, see InterAction Fields for Mail Merge Templates.
-
Restore the document to a normal Word document. This essentially “breaks” the connection between the document and the data file created in step 2. When users do a merge from the Web Client, InterAction will establish a new connection between the template and the user’s exported data.
The steps to do this vary depending on your version of Word. For details, see “Restore the Document to a Normal Word Document,” later.
-
Set a custom property indicating the type of merge to be performed as described in Set the Merge Type for a Document.
Note that this is only required for directory or catalog type merges, although it does not hurt to do it for other types as well.
-
Save or copy the document in the location described in Mail Merge Template Location.
The new template will be available to Web Client users immediately.
Restore the Document to a Normal Word Document
Perform these steps after you have created a new merge template as described in Create a New Mail Merge Template for the Web Client.
Microsoft® Word®
- If not already done, open the document.
- Display the Mailings ribbon.
- In the Start Mail Merge section, choose Create > Normal Word Document.
- Save the document.
Set the Merge Type for a Document
Microsoft Word can support different types of merges. For example, when creating letters, each contact starts a new page so that there is a separate letter for each. In contrast, a directory or catalog merge keeps the contacts on the same page and is used for lists.
This is only required in recent versions of Word. Older versions of Word can keep track of the merge type without this. However, you may want to include this even for earlier versions of Word to ensure that your merges continue to work if you upgrade in the future.
To ensure that the right type of merge always takes place, add the custom property IAMergeType to the document. Make this a Number field and set its value to one of these numbers:
| Merge Type | Property Value |
|---|---|
| Letters | 0 |
| Labels | 1 |
| Envelopes | 2 |
| Directory or Catalog | 3 |
| 4 |
This step is important if you are creating a directory or catalog merge. It is not required for the other merge types.
Microsoft® Word®
To set a custom property in Word:
- If not already done, open the document.
- Choose the File tab. From the left-hand sidebar, choose Info.
- On the right side of the screen, choose the Properties drop-down and select Advanced Properties.
- In the document properties dialog, select the Custom tab.
-
For the Name, enter IAMergeType. From the Type drop-down list, select Number, then enter the number representing the type of merge you want to perform in the Value edit box.
- Choose Add to add the new property to the list.
-
Choose OK, then save the document.
Edit a Mail Merge Template for the Web Client
To edit an existing mail merge template, open the document in Word and make changes as needed. You must have access to edit files on the Application Server machine. The templates are stored in the location described in Mail Merge Template Location.
Note that your changes may not be available immediately due to copies of the templates being saved in users’ temporary Internet files folder. You can configure the Application Server to prevent this problem; see “Ensuring that Changes to Your Templates Are Available Immediately,” next.
Ensuring that Changes to Your Templates are Available Immediately
If you edit an existing mail merge template on the Application Server, users might not see your changes right away unless they delete their Temporary Internet Files. You can update the Application Server to make the changes available immediately by setting the IA_TEMPLATES virtual folder to always expire.
- On your Application Server, open IIS (usually Start > Administrative Tools > Internet Information Services (IIS) Manager).
- In the tree area, expand the item for your server, then Sites, then Default Web Site.
- In the list, select the IA_TEMPLATES folder.
- Double-click the HTTP Response Headers item.
- Under Actions, select Set Common Headers.
- Select the Expire Web content check box then select the Expire Immediately option.
- Choose OK.
The above instructions are for IIS 7. If you are using a different version, check the IIS help for details about setting the HTTP Headers to expire immediately.
InterAction Fields for Mail Merge Templates
The following InterAction fields are available for use in a mail merge template.
Name Fields
- FullName
- NameTitle
- FirstName
- MiddleName
- GoesByName
- LastName
- NameSuffix
- Salutation
- CompanyName
- CompanyAKAName
- JobTitle
- Department
- Assistant
- IALID
- IACID
- CompanyID
- Language-Specific Fields (if enabled); see Using Language-Specific Fields in the Mail Merge Template
Phone Fields
- BusinessPhone
- BusinessFax
- BusinessPager
- BusinessMobile
- BusinessPhone2
- BusinessAsst
- BusinessEMail
- BusinessWeb
Mailing/Business Addresses
- MailingAdrType
-
MailingAdrGeneralType
MailingAdrType returns the specific type for the mailing address: Business, Business2, Alt. Business, Home, Alt. Home, or Other. MailingAdrGeneralType returns a generic value: Business, Home, or Other. This is useful when constructing IF statements in Word merge documents, since that functionality in Word does not allow complex comparisons. For more details, see Suppressing the Company Name for Home Addresses.
- MailingAdrLine1
- MailingAdrLine2
- MailingAdrLine3
- MailingAdrCity
- MailingAdrState
- MailingAdrPostalCode
- MailingAdrCountry
- MailingAdrFormatted
- BusinessAdrLine1
- BusinessAdrLine2
- BusinessAdrLine3
- BusinessAdrCity
- BusinessAdrState
- BusinessAdrPostalCode
- BusinessAdrCountry
- BusinessAdrFormatted
Home Information
- HomePhone
- HomeFax
- HomeAdrLine1
- HomeAdrLine2
- HomeAdrLine3
- HomeAdrCity
- HomeAdrState
- HomeAdrPostalCode
- HomeAdrCountry
- HomeAdrFormatted
- HomeEMail
Other
- OtherPhone
- OtherPhone2
- OtherFax
- OtherAdrLine1
- OtherAdrLine2
- OtherAdrLine3
- OtherAdrCity
- OtherAdrState
- OtherAdrPostalCode
- OtherAdrCountry
- OtherAdrFormatted
- OtherEmail
- Custom1
- Custom2
- Custom3
- Custom4
- Roles
- Responsibility
Using Language-Specific Fields in the Mail Merge Template
If your organization has configured InterAction for International Correspondence, then the language-specific fields configured for your environment are available for use in your merge template. These use the following naming convention:
<Language Name>_<Field Name>
For example, the Language-Specific Job Title field for Dutch (Netherlands) would become a merge field named:
<nl_NL_JobTitle>
Insert the language-specific fields for the particular language appropriate for your template to use the values stored in these fields. The specific fields available depend on how your organization configured International Correspondence in InterAction.
For information about enabling International Correspondence and configuring language-specific fields, see Configuring InterAction for International Correspondence.
The language-specific merge fields are only included if you select to include language-specific information when choosing a template to use as a starting point (refer back to Create a New Mail Merge Template for the Web Client).
Note that the values of the language-specific fields are entered using the Windows Client. Users cannot enter or edit these values in the Web Client or in the Word integration.
Suppressing the Company Name for Home Addresses
Most mail merge templates for InterAction use the fields for the contact’s mailing address. For example, your template might use the MailingAdrFormatted field rather than the BusinessAdrFormatted field. This is more flexible and lets users send mailings to all sorts of contacts.
However, a disadvantage is that if the template includes the company name field, that company name is included even on contacts for which the mailing address is a home address. This is usually not the desired result.
You can address this in your templates by using Microsoft Word’s IF logic. Set up the CompanyName merge field to only show if the address is a business address. To determine the type of address, you can use the export field MailingAdrGeneralType. This field always contains a value indicating the type of mailing address for the contact. It can be Business, Home, or Other.
Note that the export also includes the field MailingAdrType. This contains the full descriptive type for the address: Business, Business2, Alt. Business, Home, Alt. Home, or Other. You can use this value if you need to know the exact type.
However, note that IF fields in Word merge documents can only do exact matches. Therefore, a field to show the company name if MailingAdrType = Business would hide the company name for a Business2 or Alt. Business address. When constructing this kind of field, use MailingAdrGeneralType instead. This returns Business for addresses with the type Business, Business2, and Alt. Business.
Refer to Microsoft Word’s help for details on inserting an “IF” field in a merge document.
Including Information About the Current User in the Mail Merge Templates
You may want to customize the mail merge templates to include information about the current user. For example, you might want a line “Prepared for <user name>” in the header or footer of the Word document.
The Web Client exports InterAction-related information about the logged on user in a set of Word document variables. When customizing the report templates, you can insert these variables in the document. Similar to merge fields, the variables are replaced with the exported data when a user runs a report.
The following document variables are available:
- IAUserDisplayName
- IAUserFullName
- IAUserJobTitle
- IAUserGoesBy
- IAUserCompany
- IAUserBusinessAddress
- IAUserBusinessPhone
- IAUserBusinessFax
- IAUserBusinessEmail
- IAUserBusinessWeb
The variables are set with information about the current user. If the user is a proxy working on behalf of another user, the variables are set with information about the user on whose behalf the proxy is working.
To insert a variable into a report template, do the following:
- Create or edit the template in Word.
- In Word, choose Insert > Field.
- Under Categories select Document Automation.
- Under Field names, select DocVariable.
- Under Field properties, enter the name of the variable you want to insert and choose OK.