In this article I will explain the Ask Rule used in Mail Merge.
Note: It is assumed that readers are familiar with Mail Merge before reading this article.
What is it?
In Mail Merge we basically have a list of recipients, with specific data for each recipient. There are fields in the document (i.e Address, First Name, Last Name, …). Mail merge replaces these fields with data from the predefined list of recipients, therefore generating a list of letters specific to each recipient.
There might be fields that you would like to fill at the last moment, rather than filling the field in the data source. This can be achieved by using an Ask Field. If an Ask Field has been used in the document, when merging is taking place, a dialog will open asking you to input the value for the field. The input value will be placed in the field.
How it Works?
The ask field displays a dialog prompting the user to input a text value. This value is then stored in a bookmark variable. You can then use one or more Ref Fields to display the value stored in the bookmark variable:
Create a bookmark.
Note: This bookmark is only going to be used as a variable to store the response the user provides to the Ask Field. Therefore it does not matter where the bookmark is located.
Click on the Rules button on the Mailings Ribbon, then click on the Ask… rule:
On the window that opens, there are 4 parts:
Select the bookmark created in step 1.
The message to display to the user.
Default bookmark Text:
The default text to display if the user doesn’t input anything
If this is selected the same text will be used for all recipients.
Move the cursor to the location you would like the result of the Ask Field to display:
On the Insert ribbon click on the Quick Parts button. From the drop down menu click on Fields:
From the left select Ref, and from the list box select the bookmark the Ask Field was assigned to:
Click on the Finish and Merge button on the Mailings Ribbon. If the Ask Once option was selected a dialog will display and ask you for the text to display for all the recipients. If it was not selected a dialog will display for each recipient prompting you to input the text to fill the Ask Field with:
As you can see the “Default Text” has been placed in the Ask Field:
Inserting Response in Multiple Locations:
You might want the same response to appear in multiple location in each letter. This can be done by assigning multiple Ref Fields to the same Ask Field (Repeating Steps 3 and 4):
You can download the sample file for this article from the link below:
If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com