Word merge: Fields in headers and footers not merged
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?
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.
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.
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.
0% found this useful