You can use a standard flow action to convert Field Codes in a Microsoft Word document to values of corresponding properties on the clipboard.
This process is used to create correspondence. It is also used to support features found in the Specification and Flow forms.
This feature requires Microsoft Word and supports .doc
and .docx
file formats. Refer to the Platform Support Guide on the PDN for a list of supported versions of Microsoft Word.
Configure your browser with the Microsoft Silverlight plug-in.
Install the Pega 7Silverlight prerequisites file on your local machine:
.zip
file. You must first extract this file, run setup.exe
, and restart your browser before using the Word Merge feature. The PRPC Silverlight prerequisites file is available in the PRPC Resource Kit. System administrators can use the pzSLpreReqs.cab
file to set up multiple client systems at once.
If you are using Microsoft Word 2007 or 2010 on a Windows 7 or Vista machine, follow this procedure before using the Word merge feature. You can encounter browser error messages otherwise.
At run time, using this feature requires substantial memory on the workstation.
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.
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 mail. 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" } |
pyCategory
value the name of the attachment category you created in Step 1 above, within double-quotes. (The FileSource parameter contains a Base64-encoded file name provided by the ActiveX control.)
This feature requires Word macros contained in the template WordMacroManagerDot.Dot
template file. This file has a certificate digitally signed by Pegasystems. See Configuring Microsoft Word for inline display or editing. Operation of macros is automatic and requires no user interaction.