Answers.Body: <p>Here's what I did that worked for me:</p>
  
  <ol>
  <li>Created an MS Word doc that just had this in it: <code>Hello, {contact.display_name}</code></li>
  <li>Did a Find Contacts search.</li>
  <li>Selected a couple contacts.</li>
  <li>Chose Print/Merge Document from the Actions dropdown.</li>
  <li>Beside "Use Template" I clicked the browse button and uploaded my Word doc.</li>
  <li>Entered an Activity Subject.</li>
  <li>Chose "MS Word" as the output document type near the bottom.</li>
  <li>Clicked "Download Document".</li>
  </ol>
  
  <p>The resulting document had the display names of the selected contacts one per page.</p>
  
  <p>If that doesn't work for you then perhaps you can give more info about what you have in your MS Word document that you are uploading or if the steps you're doing are any different.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-18T08:29:52.303Z
Answers.LastActivityDate: 2019-11-18T08:29:52.303Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>Which of the various Print/Merge windows are you using - ie what steps do you take to get to that window?  (Similar-looking print/merge windows use different code so the functionality is not consistent.)</p>
  
  <p>It sounds like you are doing the right thing - ie create a Word doc with the tokens and upload it.</p>
  
  <p>Do you mean that some of the tokens work, or none at all? If so, which ones do and don't work? It depends on the context as to which tokens are available so I'd start by creating a simple test using the on-screen composer to check that the tokens are being evaluated correctly in that context.  If they don't work there, they won't work in a document.</p>
  
  <p>Be aware that the functionality with documents can produce poor results if there is complex formatting since the document is converted to html and so depends on the capability of the conversion library.  You might find that converting to ODT produces better - or worse - results compared to DOCX.</p>
  
  <p>In a recent project, we concluded the best option was to do the conversion to html outside of Civi and paste it into the on-screen composer window using the 'Source' button.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-18T09:24:33.730Z
Answers.Text: There is a helpful website called word2cleanhtml.com which you could use if you do what Aidan describes in the last paragraph - which is the approach I would recommend.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-18T08:43:23.673Z
Answers.LastActivityDate: 2019-11-18T08:43:23.673Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>I am having exactly the same issue. The Contact ID will merge, but none of the other fields will</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-23T09:48:31.190Z
Answers.Text: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://civicrm.stackexchange.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). You can also [add a bounty](https://civicrm.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/15603)
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-26T09:28:25.387Z
Answers.Text: Is this a bot? I was just saying that I had the same issue.
Answers.UserDisplayName: Michael FORWARD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-26T16:31:03.533Z
Answers.Text: No, I'm not a bot! You have posted this as an answer but it doesn't appear to answer the question so it is likely to be deleted. Do none of the other answers help? If not, I suggest you ask a new question.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-27T15:57:03.220Z
Answers.Text: Sorry, it's just that it seemed like a non-sequitur. There didn't seem to have been an answer to the question five years ago, so I wanted to keep it alive by confirming that it was still an issue. I can ask it again separately of course.
Answers.UserDisplayName: Michael FORWARD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-28T16:08:32.547Z
Answers.Text: I'm not sure I follow. There are two answers to the question above. I presume neither of these was helpful for you? If so, you are better off asking a new question. You are unlikely to get any answers by posting your question here. Alternatively you could try in chat: https://chat.civicrm.org/
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-29T12:05:27.687Z
Answers.Text: I have posted a new question as you suggest. One of the answers above confirmed that it was the right way to do it, but didn't address why it doesn't work. The other referred to HTML, but the question was about printed documents as I understood it. Maybe I got that wrong.
Answers.UserDisplayName: Michael FORWARD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-20T12:09:14.323Z
Answers.LastActivityDate: 2024-11-20T12:09:14.323Z
Answers.UserDisplayName: Michael FORWARD
Body: <p>Can anybody kindly help me to understand how to use the Word upload function in the Print/Merge window?</p>
  
  <p>I have tried to insert the CiviCRM tokens into the Word file before uploading the file and doing the Print/merge -> does not associate all tokens to the values from the database.</p>
  
  <p>I have tried create a Message Template with a Word uploaded file, then to go to the Print/Merge function -> does not associate all tokens to the values from the database either.</p>
  
  <p>Therefore my questions: how should the tokens be inserted into the Word file before doing the upload? Is there any special code that needs to be used?
  If anybody can provide User-feedback after using this function, I will be very grateful.</p>
  
  <p>Thanks for your help.</p>
  
  <p>(Drupal 7.67 &amp; Civi 5.7.0)</p>
  
  <p><em>(this is a more precise question, following the question and the answers from last week in Stackexchange : <a href="https://civicrm.stackexchange.com/questions/33658/how-do-use-upload-function-for-mail-merge-with-word">How do use upload function for mail merge with Word</a>)</em></p>
  
Tags: <upload><printmerge>
Title: How to use Word upload in Print/Merge function?
ThreadText: # How to use Word upload in Print/Merge function?
  
  (Asked by: username_0 on 2019-11-17)
  
  Can anybody kindly help me to understand how to use the Word upload function in the Print/Merge window?
  
  I have tried to insert the CiviCRM tokens into the Word file before uploading the file and doing the Print/merge -> does not associate all tokens to the values from the database.
  
  I have tried create a Message Template with a Word uploaded file, then to go to the Print/Merge function -> does not associate all tokens to the values from the database either.
  
  Therefore my questions: how should the tokens be inserted into the Word file before doing the upload? Is there any special code that needs to be used?
  If anybody can provide User-feedback after using this function, I will be very grateful.
  
  Thanks for your help.
  
  (Drupal 7.67 & Civi 5.7.0)
  
  *(this is a more precise question, following the question and the answers from last week in Stackexchange : [How do use upload function for mail merge with Word](https://civicrm.stackexchange.com/questions/33658/how-do-use-upload-function-for-mail-merge-with-word))*
  
  **Tags:** upload, printmerge
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-11-18. Score: 1
  
  Here's what I did that worked for me:
  
  1. Created an MS Word doc that just had this in it: `Hello, {contact.display_name}`
  2. Did a Find Contacts search.
  3. Selected a couple contacts.
  4. Chose Print/Merge Document from the Actions dropdown.
  5. Beside "Use Template" I clicked the browse button and uploaded my Word doc.
  6. Entered an Activity Subject.
  7. Chose "MS Word" as the output document type near the bottom.
  8. Clicked "Download Document".
  
  The resulting document had the display names of the selected contacts one per page.
  
  If that doesn't work for you then perhaps you can give more info about what you have in your MS Word document that you are uploading or if the steps you're doing are any different.
  
  
  ---
  
  ### Answer by username_2 on 2019-11-18. Score: 1
  
  Which of the various Print/Merge windows are you using - ie what steps do you take to get to that window? (Similar-looking print/merge windows use different code so the functionality is not consistent.)
  
  It sounds like you are doing the right thing - ie create a Word doc with the tokens and upload it.
  
  Do you mean that some of the tokens work, or none at all? If so, which ones do and don't work? It depends on the context as to which tokens are available so I'd start by creating a simple test using the on-screen composer to check that the tokens are being evaluated correctly in that context. If they don't work there, they won't work in a document.
  
  Be aware that the functionality with documents can produce poor results if there is complex formatting since the document is converted to html and so depends on the capability of the conversion library. You might find that converting to ODT produces better - or worse - results compared to DOCX.
  
  In a recent project, we concluded the best option was to do the conversion to html outside of Civi and paste it into the on-screen composer window using the 'Source' button.
  
  > **Comments:**
  > **username_3**: There is a helpful website called word2cleanhtml.com which you could use if you do what username_2 describes in the last paragraph - which is the approach I would recommend.  
  
  ---
  
  ### Answer by username_4 on 2024-11-20. Score: 0
  
  I am having exactly the same issue. The Contact ID will merge, but none of the other fields will
  
  > **Comments:**
  > **username_5**: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://civicrm.stackexchange.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). You can also [add a bounty](https://civicrm.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/15603)  
  > **username_4**: Is this a bot? I was just saying that I had the same issue.  
  > **username_5**: No, I'm not a bot! You have posted this as an answer but it doesn't appear to answer the question so it is likely to be deleted. Do none of the other answers help? If not, I suggest you ask a new question.  
  > **username_4**: Sorry, it's just that it seemed like a non-sequitur. There didn't seem to have been an answer to the question five years ago, so I wanted to keep it alive by confirming that it was still an issue. I can ask it again separately of course.  
  > **username_5**: I'm not sure I follow. There are two answers to the question above. I presume neither of these was helpful for you? If so, you are better off asking a new question. You are unlikely to get any answers by posting your question here. Alternatively you could try in chat: https://chat.civicrm.org/  
  > **username_4**: I have posted a new question as you suggest. One of the answers above confirmed that it was the right way to do it, but didn't address why it doesn't work. The other referred to HTML, but the question was about printed documents as I understood it. Maybe I got that wrong.  
  
  ---
  
  