Back ForwardHow to provide Word merge operations

What is the Word merge feature?

Advanced featureThrough a standard flow action, your application can convert Field Codes in a Microsoft Word document of DOC file format to the values of corresponding properties on the clipboard, during the production of correspondence.

Prerequisites and restrictions

This capability requires Microsoft Word 2002, 2003, 2007, or 2010.

Client browsers must be configured with the Microsoft Silverlight plug-in which replaces previous ActiveX dependencies. For details on how to set up plug-ins on each of our supported browsers, see browser setup.

Once Microsoft Silverlight has been installed, users must then install the PRPC Silverlight prerequisites file. Versions of IE will automatically prompt to download and install this file the first time a feature integrated with Word Merge is used. Versions of non-IE browsers will display a dialog to download a .zip file; users must extract the file, execute setup.exe and restart their browser when finished.

For system administrators who set up multiple client systems at once, the PRPC Silverlight prerequisites file is available as pzSLpreReqs.cab in the PRPC Resource Kit.

CautionAt runtime, using this feature requires substantial memory on the workstation.

NoteWord 2007 and 2010 on Vista and Windows 7: When running in one of these configurations, each application end user who you expect to use Word merge operations when accessing your application in their browser must complete certain steps on their workstations before using your application's Word merge operations. Otherwise, they might see browser error messages when using your application's Word merge operations in their browsers. See the section How to set up Microsoft word for inline display or editing — Word 2007 and 2010 on Vista and Windows 7.

Example

You can review this capability using two flow actions included in the sample flow PegaSample.WordEmbedMergeTest.

The first flow action PegaSample.EmbedWordTextAreaSet supports inline editing for three properties: pyDescription, pyMyEdits, and pyNewFormula.

The second flow action PegaSample.CreateMergedWordDoc searches these property values — each a Word document — for Field Codes that represent clipboard properties, and merges in the current values. You can also insert HTML code from correspondence rules, images from binary file rules, and other text as Field Codes.

How to configure clipboard merge operations

  1. Create an attachment category for the document. About Attachment Category rules.
  2. Design the appearance of the document.
  3. Create a Rule-Template-Word rule.
  4. In the Word Template rule form, click Edit Word Template to open a blank Word document in the Word installed on your workstation.
  5. Using Microsoft Word, compose your document.
  6. In Word, turn on the setting to show field codes instead of their values. (The steps to do this vary depending on your version of Word. The checkbox is typically in the Options > Advanced or Options > View set of option settings.)
  7. At the appropriate locations in the document, insert fields using one or more of these field codes as appropriate. (This are field codes, not JSP tags, though the syntax is similar.)

Syntax

Result during clipboard merge

{pega:reference propertyreference }

Include the value of a scalar property present on the clipboard page.

{pega:attachment attachmentName }

Include the contents of an attachment.

{pega:binaryfile binaryFileName }

Include the value of a binary file rule. Identify all three key parts of the rule using the format AppName.imageFileName.FileType.

{pega:insert corr="Name" }

Include the HTML code text from a correspondence rule with Name as the second key part. The final key part of the correspondence rule must be email.

After processing and the insertion of the text to the Word template, no newline will be added after the text. Use this Field Code to include the formatted and stream processed content of a correspondence rule within existing text contained in the Word template or in scenarios where template formatting requires no additional newline after the inserted text.

{pega:binary imagefile=imageFileName }

Include the image associated with a binary file rule. Identify all three key parts of the rule using the format AppName.imageFileName.FileType.

{pega:binary imagefilelocalpath="LocalPath" }

Include a local image. For example:
{pega:binary imagefilelocalpath="C:\donut.jpg" }
  1. In Word, hide the field codes by clearing the setting to show field codes instead of their values.
  2. When your document is ready, protect all or parts of the document using Word's Protect Document setting. You can protect the entire document, or only specific sections defined by Word section breaks.
  3. Use the Save operation in Word to save the document into the Word Template rule. Then save the Word Template rule form.
  4. Configure at least one harness or section to include the property as an input field, following the instructions above.
  5. Copy and modify the standard flow action PegaSample.CreateMergedWordDoc into an appropriate RuleSet and Applies To work type in your application.
  6. Save the flow action. Update a flow rule to reference the flow action.
  7. Test.

Internal notes

This facility requires Word macros contained in the template WordMacroManagerDot.Dot template file. This file has a certificate digitally signed by Pegasystems. See  How to set up Microsoft Word for inline display or editing. Operation of macros is automatic and requires no user interaction.

Definitions open authoring
Related topics About Word Template rules
How to provide inline Word property display
How to set up Microsoft Word for inline display or editing

UpUser Interface category