none
mail merge problem with dotm-files RRS feed

  • Question

  • Hello,

    sometimes before we have converted documents of an old MS Word version to dotm Files in Word 2013 to use it for mail merge.

    The files contain mail merge controls that point to a database view. The view is declared by a VBA-macro in the dotm file that starts while opening the file. The word documents are opened by button click in an access frontend. Up to this point it works!

    Now I have to add new address controls to the files. But everytime I open one of the dotm files as a template the word comand for changing between preview and result of the address fields and all other commands for editing the mail merge functions are disabled.

    After that I opened a doc file based on the dotm file, added the address controls and saved it as a new dotm template. But this dotm template doesn't work correctly. When I use the document by starting it from the access front end, it doesn't show the newly added controls and the old controls are only shown with their name and not with their values.

    Where is my mistake?

    Joachim

    Wednesday, November 25, 2015 12:49 PM

Answers

  • Hi Joachim

    I believe this is your problem:

    <<The view is declared by a VBA-macro in the dotm file that starts while opening the file.>>

    The mail merge tools are only available if the data source is attached to the Word file. The template has been saved without a data source attached, so the buttons on the Ribbon aren't enabled. (Note that this is the same behavior as in earlier versions of Word, where you say the template was created - this is not a change.)

    You can either attach the data source OR you can insert the MergeFields manually, as long as you know the exact data field names coming in from the Access "view". In order to insert MergeFields manually:

    1. Press Alt+F9 to toggle on the field code display. Note how existing merge fields are constructed.
    2. Click where you need a new merge field.
    3. Press Ctrl+F9 to insert a pair of field brackets. They'll look like { } but you CANNOT insert a field bracket pair using the keyboard other than by pressing Ctrl+F9!
    4. Type the field name (MERGEFIELD) and the name of the data field between the brackets, using existing MergeFields as a guide.
    5. Repeat 2 through 4 for each field.
    6. When you're done, press Alt+F9 again to toggle back to the field result display. You won't be able to see a preview with no data source attached, so you'd need to run a test merge from within Access to double-check your work.

    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    • Proposed as answer by David_JunFeng Thursday, November 26, 2015 2:28 AM
    • Marked as answer by Joachim__B Thursday, November 26, 2015 9:56 AM
    Wednesday, November 25, 2015 3:59 PM
    Moderator

All replies

  • Hi Joachim

    I believe this is your problem:

    <<The view is declared by a VBA-macro in the dotm file that starts while opening the file.>>

    The mail merge tools are only available if the data source is attached to the Word file. The template has been saved without a data source attached, so the buttons on the Ribbon aren't enabled. (Note that this is the same behavior as in earlier versions of Word, where you say the template was created - this is not a change.)

    You can either attach the data source OR you can insert the MergeFields manually, as long as you know the exact data field names coming in from the Access "view". In order to insert MergeFields manually:

    1. Press Alt+F9 to toggle on the field code display. Note how existing merge fields are constructed.
    2. Click where you need a new merge field.
    3. Press Ctrl+F9 to insert a pair of field brackets. They'll look like { } but you CANNOT insert a field bracket pair using the keyboard other than by pressing Ctrl+F9!
    4. Type the field name (MERGEFIELD) and the name of the data field between the brackets, using existing MergeFields as a guide.
    5. Repeat 2 through 4 for each field.
    6. When you're done, press Alt+F9 again to toggle back to the field result display. You won't be able to see a preview with no data source attached, so you'd need to run a test merge from within Access to double-check your work.

    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    • Proposed as answer by David_JunFeng Thursday, November 26, 2015 2:28 AM
    • Marked as answer by Joachim__B Thursday, November 26, 2015 9:56 AM
    Wednesday, November 25, 2015 3:59 PM
    Moderator
  • Hi Cindy,

    it seems to work. My first test ran perfectly!

    Thank you for your help!

    Joachim

    Wednesday, November 25, 2015 5:19 PM
  • You're quite welcome :-) If you're satisfied all is good it would help forum adminstration if you'd take a moment to mark the useful information as "the Answer".

    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    Wednesday, November 25, 2015 7:16 PM
    Moderator