locked
Header and footer merge fields stripped of data RRS feed

  • Question

  • Hello,

    Our company runs mail merge reports populated with data from Microsoft Dynamics CRM 2013. The Mail Merge populates all the fields correctly but using the save as PDF option clears the information in the header and footer leaving the <<mergefield>>. I've tested across a number of mail merges with the same result.

    These were completed mail merges saved to SharePoint. They were run as "Letter" Mail Merges. Saving the PDF removes the header/footer data of the open Word document as well as excluding it from the PDF. The header/footer information is still there in the original, saved copy of the Word document but not the open version. The issue also occurs when using print preview

    Is there a fix or even workaround for this issue?

    Using Word 2013, SharePoint 2013, Windows 7 and 8.


    Timon


    • Edited by Timon.NZ Monday, May 30, 2016 3:14 AM
    Monday, May 30, 2016 2:18 AM

Answers

  • Again, for whatever reason, your original method apparently is not creating a completed merge document.

    The second ribbon you are showing certainly does reflect a document not connected to a data source. You will see this in a final merge document or in a primary merge document disconnected from its data source. However, the Mailings tab would not be showing in a completed merge document. Instead, the Home tab would be showing unless someone switched to the Mailings tab.

    In a non-completed primary merge document (that was in preview mode prior to being made a normal document or otherwise separated from the data source) you will see merge codes if you select a field and press F9. Without the field update you see the last result from the preview. A completed merge document will contain no merge fields.

    A completed merge always contains next page section breaks between records (letter mode) and has a continuous section break at the end. The header/footer information for a section is contained in the section break which follows it. The last paragraph mark in a document is also a section mark.


    Charles Kenyon Madison, WI

    • Marked as answer by Steve Fan Monday, June 13, 2016 1:56 AM
    Friday, June 3, 2016 12:09 PM

All replies

  • Hi,

    I have tried it but failed to replicate the issue. The merge fields show correctly in the header and footer when printed to PDF.

    Are the merge fields inside Shapes or text boxes in the header and footer?

    Would you please share the documents to us so that we can try to reproduce it in our environment? You can share the documents to us via GBSD TN Office Information Collection ibsofc@microsoft.com. Please involve the thread URL in the email message for easy follow-up.

    In addition, I found a similar issue in the forum, please have a look at it and see if it applies to your situation:

    https://social.technet.microsoft.com/Forums/office/en-US/9f6b622d-b614-48f7-8b52-72b530014e7b/mail-merge-header-footer-print-with-mergefiled-instead-of-data?forum=word

    Regards,

    Steve Fan
    TechNet Community Support


    Please mark the reply as an answer if you find it is helpful.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com.
    Tuesday, May 31, 2016 6:18 AM
  • The only way I've been able to replicate this is with an uncompleted merge in preview mode. In that case, I go to the footer in question and press F9 to update it, then save or print. I am not working with Sharepoint.

    Charles Kenyon Madison, WI

    Tuesday, May 31, 2016 12:39 PM
  • Hi Steve,

    I did spot that other thread you mention but it didn't resolve my issue unfortunately. And the document does have a text box in the first page header but not in subsequent page headers.

    I've sent across a completed merge word file and a more detailed description of the issue. Interested to see if you can replicate the issue

    Thanks


    Timon

    Thursday, June 2, 2016 2:50 AM
  • Hi Charles,

    I have definitely gone past the preview stage, completed the merge and saved the document. If I do highlight any of the merge fields and press F9 it replaces the text with the <<merge field>>. This applies to any of the merge data throughout the document.

    I re-iterate these are not previews they are completed merges that have been saved as word files 


    Timon

    Thursday, June 2, 2016 4:21 AM
  • Hi Charles,

    I have definitely gone past the preview stage, completed the merge and saved the document. If I do highlight any of the merge fields and press F9 it replaces the text with the <<merge field>>. This applies to any of the merge data throughout the document.

    I re-iterate these are not previews they are completed merges that have been saved as word files 


    Timon

    In a completed merge there are no merge fields.

    What you are describing is a primary merge document rather than a merge result document. I regularly use primary merge documents in preview mode to produce documents. Again, there is no way you are going to see <<merge field>> in a merge result document unless someone typed that text, and you won't get that by pressing the F9 key.

    To get a result document, you must merge to a new document for editing.


    Charles Kenyon Madison, WI

    Thursday, June 2, 2016 12:28 PM
  • Hi Charles,

    Thanks for taking the time to reply

    Trying the Finish and merge command from the ribbon as you suggested (skips the preview results step) was successful and did not wipe the merged data from the header and footers when saving a PDF/print. Also F9 no longer changes the fields to <<mergefield>>. I can't see why my process using the mail merge pane resulted in failure and the Finish & Merge in the ribbon worked!? I guess I can advise users not to use the mail merge pane as a workaround.

    The steps I originally took are as below:

    1. Ran the mail merge from Dynamics CRM
    2. Previewed the results (using mail merge pane)
    3. Completed the mail merge (using mail merge pane)
    4. Selected Edit individual letters (using mail merge pane)
    5. Saved the new file (Letters1) as .docx (tested both SharePoint and local PC)
    6. Opened saved document
    7. File>Save As>PDF

    It was after step 6, opening the saved, completed document that I tried

    • printing
    • saving as PDF
    • pressing F9

    Using the Finish & Merge in the ribbon did create another issue however, there's a section break added to the last line of the merge result document. Removing this section break still wipes the headers and footers and leaves <<mergefield>>

    See images below.

    with section break and headers intact

    with section breakwithout section break and merge fields exposed

    without section break


    Timon



    • Edited by Timon.NZ Friday, June 3, 2016 12:44 AM
    Friday, June 3, 2016 12:40 AM
  • When you click on "Complete the Merge" in the Mail Merge Wizard (pane) you need to complete one more step.

    You could, I suppose, print to pdf, as well.


    Charles Kenyon Madison, WI

    Friday, June 3, 2016 1:30 AM
  • Why are you deleting the section break? That section break contains the headers and footers for the section that precedes the section break.

    Sections / Headers and Footers in Microsoft Word 2007-2013


    Charles Kenyon Madison, WI

    Friday, June 3, 2016 1:34 AM
  • I did complete the Edit individual letters step (see step 4 in my process). It was after saving the resulting  document (Letters 1) that I attempted saving as PDF and printing. It still replaced the text with merge field after all those steps.


    Timon

    Friday, June 3, 2016 1:59 AM
  • Why are you deleting the section break? That section break contains the headers and footers for the section that precedes the section break.

    Sections / Headers and Footers in Microsoft Word 2007-2013


    Charles Kenyon Madison, WI


    This was discovered when a user accidentally overwrote the section break. The section break is inserted into the document on the last line of the document which is a signature block. I removed this in my screen grabs to avoid posting personal information. The user copied and pasted over this section break unwittingly. As they didn't have the formatting marks visible this is an easy mistake to make.

    For whatever reason the section break problem doesn't occur when the document is created in my original method. Users are finding this mail merge process difficult already and it seems to break quite easily if you use wrong buttons (mail merge pane) or delete an invisible line from the document.


    Timon

    Friday, June 3, 2016 2:07 AM
  • Again, for whatever reason, your original method apparently is not creating a completed merge document.

    The second ribbon you are showing certainly does reflect a document not connected to a data source. You will see this in a final merge document or in a primary merge document disconnected from its data source. However, the Mailings tab would not be showing in a completed merge document. Instead, the Home tab would be showing unless someone switched to the Mailings tab.

    In a non-completed primary merge document (that was in preview mode prior to being made a normal document or otherwise separated from the data source) you will see merge codes if you select a field and press F9. Without the field update you see the last result from the preview. A completed merge document will contain no merge fields.

    A completed merge always contains next page section breaks between records (letter mode) and has a continuous section break at the end. The header/footer information for a section is contained in the section break which follows it. The last paragraph mark in a document is also a section mark.


    Charles Kenyon Madison, WI

    • Marked as answer by Steve Fan Monday, June 13, 2016 1:56 AM
    Friday, June 3, 2016 12:09 PM
  • Even if you display formatting marks in Print Preview display, often a section break will be hidden at the end of a line. The only way I know of to be sure of seeing section breaks is to display in draft (formerly normal) view.


    Charles Kenyon Madison, WI

    Friday, June 3, 2016 12:13 PM
  • The best resource of which I am aware for mail merge is Paul Edstein's tutorial.

    Word Mailmerge Tips & Tricks | Windows Secrets Lounge


    Charles Kenyon Madison, WI

    Friday, June 3, 2016 12:17 PM