Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Word merge: Fields in headers and footers not merged

SA-1329

Summary



In a proof-of-concept project, you want to demonstrate the Microsoft Word Merge functionality in PRPC.
You observe that fields inside a Word document header and footer do not merge. Fields in the body of the Word document merge as expected.
Is this behavior correct?


Error Messages



Not Applicable


Steps to Reproduce



1. With Internet Explorer, open the PRPC application.
2. Open or create a proposal.
3. Click Actions and choose Create synthesis document.
4. Click Create merge document to open Microsoft Word and create a new document. Fields can be blank because there is no data in the application.


Root Cause



The reported behaviour with fields in document headers and footers not merging is to be expected because this functionality is not currently supported by the product. 


Resolution



To resolve this issue, perform the following Local-change, which takes advantage of the Word Bookmark and Field Reference features:

1. Create a bookmark in the Word document that covers the PRPC Field Code that you want to include in the header or footer.
    Make sure that the bookmark covers the space before and after the insert.
2. Reference the bookmark in the Word header or footer using the Word Field ‘Ref’ syntax.
3. Because of the runtime substitution of the PRPC Field Codes, you must refresh the Word Field reference AFTER the document content has been populated. 
    Choose one of the following ways to refresh the Word Field reference:
  • Manual Refresh
    a. Select the Word Field reference in the header or footer.
    b. Right-click the menu option Update Field.
  • Automatic Refresh
    Include a custom macro in each document, as shown in this example screen:



Limitations of using a custom macro

You won't be able to add a bookmark to content that has been included by means of a correspondence (CORR) insert. For example, if a recipient name is added to the document using CORR and this is needed in the document header or footer, it won't be possible to bookmark just the recipient name text from the CORR that is inserted. In this approach, the recipient name would have to be a direct property reference to the clipboard in the Word template; then it could be bookmarked and referenced individually.

Also consider the maintenance effort involved in applying a custom macro to each template that requires header or footer inclusion and updating each template -- if that  approach is taken rather than having users manually update the field codes. 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice