Back ForwardHow to provide Word merge operations

What is the Word merge feature?

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

Prerequisites and restrictions

This capability works with Internet Explorer browsers only, and requires Microsoft Word 2002 and 2003. (Word 2007 is supported only in 2003 compatibility mode.)

CautionAt runtime, this requires substantial memory on the workstation.

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. Click  Edit Template   download a blank Word document.
  5. Using Microsoft Word, compose your document.
  6. Select Tools>Options>View from the Microsoft Word menus and select the Field Codes check box to make Word's Field Codes temporarily visible.
  7. At the appropriate locations, choose Insert >Field from the Microsoft Word menu and enter one or more of these codes as appropriate. (This are field codes, not HTML directives, 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:insert corr="Name" }

Include the HTML code text from a correspondence rule with Name as the second key part.

{pega:attach CategoryName }

Include the HTML code text from a Word document that is the newest file attachment of the category CategoryName.

{pega:binary binaryfile=Name }

Include the Word document associated with a Rule-Template-Word rule. Include both key parts of the rule using the format AppliesToClass.Purpose.

{pega:binary imagefile=Name }

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

{pega:binary imagefilelocalpath="Path" }

Include a local image. For example:
{pega:binary imagefilelocalpath="C:/donut.jpg" }

7. Select Tools>Options>View from the Microsoft Word menus and clear the Field Codes check box to hide the Word Field Codes.

8. When your document is ready, protect all or parts of the document using Word's Tools > Protect Document task pane. You can protect the entire document, or only specific sections defined by Word section breaks.

9. Save the document into the Word Template rule. Then save the Word Template rule form.

10. Configure at least one harness or section rule to include the property as an input field, following the instructions above.

11. Copy and modify the standard flow action PegaSample.CreateMergedWorkDoc into an appropriate RuleSet and Applies To work type in your application.

11. Save the flow action rule. Update a flow rule to reference the flow action.

12. Test.

Internal notes

This facility requires the prVisioInterface ActiveX control and Word macros contained in the template WordMacroManagerDot.Dot template file. Both files have certificates digitally signed by Pegasystems. See  How to set up Microsoft Word for inline property display. Operation of the ActiveX control and macros is automatic and requires no user interaction.

Definitions ActiveX control, open authoring
Related topics About Word Template rules
How to provide inline Word property display
How to set up Microsoft Word for inline property display

UpUser Interface category