Administering Microsoft Word Templates

Aptify integrates with Microsoft Word to provide a mail merge wizard that loads view data into pre-defined templates, which are stored in the Object Repository. These templates easily generate targeted letters and labels that can improve the efficiency with which your organization communicates with its customers and/or members.

Aptify's integration with Microsoft Word requires Microsoft Word 2003 or later

The following is an overview of how to use Microsoft Word mail merge templates with Aptify:

  1. The Aptify MS Word Integration wizard is available for the Persons entity by default. If necessary, an administrator can add the wizard to one or more additional entities. See Adding the MS Word Integration Wizard to an Entity for more details.
  2. An administrator adds one or more Word Template Categories.
  3. An administrator creates one or more Word Templates and adds them to the Object Repository.
  4. A User creates a list view that displays the records to include in the mail merge document.
  5. The user launches the Aptify MS Word Integration wizard and selects a template to create a mail merge document using the data from the view.

    The Aptify MS Word Integration wizard can be run from any list view (including prompted views and temporary views). Other view types are not supported.

The following sub-topics contain instructions on how to perform the following tasks:

Adding the MS Word Integration Wizard to an Entity

The Aptify MS Word Integration wizard is available for the Persons entity by default. If you only plan to use the Aptify mail merge functionality with Persons, you do not need to complete this procedure.

However, an administrator can add the Aptify MS Word Integration wizard to any entity in the system by following these steps:

See Adding Wizards to an Entity for detailed instructions on how to add a wizard to an entity.

 

  1. Open the Entities record for the entity and click the Configuration > Actions tab.
  2. Open a new Actions record and enter the following values:
    • Name: Mail Merge Wizard (or whatever text you want to display in the tool text that appears when a user places a mouse cursor over the wizard icon in the view toolbar)
    • Action Assembly: AptifyMSWordIntegration
    • Action Class: Aptify.Framework.MicrosoftWord.TemplateWizardForm
    • Action Object: DataModules.Aptify MS Word Integration
    • Description: Enter a description if desired.
    • Icon: Specify an icon from the Object Repository to use for this wizard in the entity's toolbar. Note that the system will use the standard wizard icon if you leave this field blank. Icon Small is currently not implemented.
    • Run From options: Clear the Run From Entity Browser option; the wizard cannot be run the entity browser. However, you can select the Run From Temporary View and Run From Prompted View options — the Aptify MS Word Integration wizard can be run from temporary views or prompted views. 
       
      Setting Up the Mail Merge Wizard for an Entity 
  3. Click OK.
  4. Save and Close the entity.

Creating Word Template Categories

For each entity to which you added the wizard, an administrator needs to link it to one or more top-level Word Template Categories before a user can launch the Aptify MS Word Integration wizard from that entity. Follow these steps:

  1. Expand the Aptify Framework Administration application.
  2. Locate the Word Template Categories service.
  3. Open an existing record or create a new record.
    • For new records, specify a category name. If this record corresponds to a sub-category of an existing category, specify the parent category in the Parent field. 

      Word Template Categories Record
  4. Click the Entities tab.
  5. Add a sub-type record for each entity that you want to link to the category.
    • When linking an entity to a sub-category, note that the category will not be available in the wizard unless the entity is also linked to the parent category.  

      Specifying Entities for a Category
  6. Save and close the record. 

Creating Word Templates

Administrators create new templates and add them to the Object Repository. Follow these steps:

  1. Open or create a view of a service that has the Aptify MS Word Integration wizard available.
  2. Select the wizard's icon from the view toolbar. This opens the Aptify MS Word Integration dialog.
    • The wizard will not open if this entity does not have at least one top-level Word Template Categories associated with it. 
  3. Select a category from the list on the left-hand side of the dialog.
  4. Right-click in the Template gray area and select Create Template from the pop-up menu.  

    MS Word Integration Dialog
  5. A blank Microsoft Word document opens. Use this document to design the Mail Merge template.
    • Microsoft Word includes a Mail Merge toolbar that provides easy access to mail merge features. This includes inserting fields into the document and previewing the results. The Mail Merge toolbar is circled in the figure below.

      Microsoft Word can only use the entity fields that are included in the View from which you launched the wizard. Therefore, any field you add to the template must also be present in the view which users will use as the source for their mail merge documents.

      Mail Merge Document

  6. Save the Microsoft Word Mail Merge document to a location on your local computer or on the network.
  7. Close Microsoft Word and a New Word Template Record window appears automatically.
  8. Enter a Name and Description for the template.
  9. Add the entity from which you launched the wizard to the Entity section of the form.
    • This links the template to an entity, so the template appears as a selection in the Aptify MS Word Integration wizard when launched from this entity.  

      New Word Template Form
  10. Add the template you just created to the Object Repository by clicking the icon to the right of the Repository Object field. (This icon is circled in the figure below.)
    • In general, the template file should be placed in the same Object Repository Package that stores the rest of your organization's configurations.
    • Follow these general steps to add the template to the repository:
      1. Click the Object Repository icon to open the Select Object Repository Object dialog.
      2. Double-click the Context where you want to store the template.
      3. Double-click the Package in that Context where you want to store the template.
      4. Double-click Text File as the Object Type.
      5. Click the New button to open an Open dialog.  

        Select Object Repository Object Dialog 
      6. Browse to the location where you saved the new template file, select the file, and click Open.
      7. Click Yes if prompted by Microsoft Word to run a specified SQL command, as shown in the figure below. The template is then added to the Select Object Repository Objects dialog.

        Microsoft Word uses a temporary comma separated value (CSV) file, which Aptify generates based on the data in the view. By default, Aptify stores this CSV file in the Aptify Program Files directory. You can specify a different location for the CSV files, if desired. See Specifying a Default Path for Temporary Data for details. 

      8. Select the template from the Select Object Repository Objects dialog and click OK. This automatically populates the Repository Object field on the New Word Templates record in the following format: Package Name.Object Name
  11. Click OK to save and close the record.
  12. Click Exit to close the Aptify MS Word Integration wizard.

    You can also add any pre-existing templates manually from the Word Templates service (located in the Aptify Framework Administration application). See About the Word Templates Form for more information on this form.

Editing Word Templates

If you try to open an existing mail merge template directly in Microsoft Word, you can modify the text of the document but you will not be able to change any of the linked field information (since the document will not have access to the Aptify database).

Follow these steps to edit a template:

  1. Copy the original template document to a location on your local computer or network.
    • You can download the template from the Object Repository, if necessary. 
  2. Create or open a view of an entity linked to the template you want to modify.
  3. Launch the Aptify MS Word Integration wizard.
  4. Open the template you want to modify from the wizard.
  5. Modify the template as necessary.
  6. Overwrite the original template on your local computer or network with this new version of the document.
    • In other words, save the new template with the same name and in the same location as the old template to overwrite it. 
  7. Close Microsoft Word and the Aptify MS Word Integration wizard.
  8. Open the template's Object Repository Objects record from the Object Repository Administration dashboard.
  9. Click the Local Filename icon to open the Select File dialog.  
  10. Browse to the location where you saved the updated template file, select the file, and click Open.
  11. Save and Close the Object Repository Objects record.
    • Click Yes if prompted by Microsoft Word to run a specified SQL command, as shown below.

       Updating a Template's File in the Repository
  12. To test that the new template appears when you run the wizard, complete these steps:
    1. Close and reopen Aptify.
    2. Launch the Aptify MS Word Integration wizard.
    3. Open the template you modified and confirm that the modified version appears.

      You can also manually download the latest version of updated files manually without having to close and reopen Aptify. See Downloading an Object or Object Package Using the Dashboard for details.

Using Word Templates

The following steps describe how a user can open an existing template to create a mail merge document in Microsoft Word using Aptify view data:

  1. Open or create a list view of an entity that has the Aptify MS Word Integration wizard available.
    • To function correctly, this view must contain all of the fields that are included in the mail merge template. 
  2. Click the mail merge icon in the view toolbar to open the Aptify MS Word Integration wizard.
  3. Select a category to display the list of templates in that category. 

    Select Template Category 
  4. Select a Word Template from the list and click Show.
    • Microsoft Windows opens automatically and imports the data from the current view. 
  5. Use the Microsoft Word Mail Merge toolbar to create documents or printouts customized for each record in the view.
    • For example, clicking the View Merged Data button fills in the field variables with the corresponding field data from the view. For example, the following figure shows the merge results for the record in the view.

      Mail Merge Results 
    • Refer to Microsoft Word's on-line for more information on how to use Microsoft Word's Mail Merge features. 
  6. Close Microsoft Word when finished.
  7. Select another template to open or click Exit to close the Aptify MS Word Integration wizard. 

Specifying a Default Path for Temporary Data

When a user opens a mail merge template, Aptify exports the view information to a temporary comma separated value (CSV) file, which Microsoft Word then uses to import the data.

By default, Aptify stores this CSV file in the Windows Temp directory. If desired, you can specify a different location for the CSV files by using the MergeFolder attribute in the Word Templates entity.

Follow these steps to configure this attribute:

  1. Expand the Aptify Framework Administration application.
  2. Locate the Entities service.
  3. Open the Word Templates record in the Entities service.
  4. Click the Configuration > Attributes tab.
  5. Open a new Attributes sub-type record, enter the following information, and click OK:
    • Name: MergeFolder
    • Value: The location of each user's local computer where you want to temporarily store the CSV files generated by the Aptify MS Word Integration wizard. End the path with a back slash. For example, C:_ or _C:\Windows\Temp.
    • Description: This field is optional.  

      MergeFolder Attributes Record
  6. Save and Close the Entities record.
  7. Close and restart Aptify for this change to take effect. 
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.