1

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)

3 Answers 3

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.

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.

1
  • 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.
    – Andy Clark
    Commented Nov 18, 2019 at 9:24
0

I am having exactly the same issue. The Contact ID will merge, but none of the other fields will

6
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. You can also add a bounty to draw more attention to this question. - From Review Commented Nov 23 at 9:48
  • Is this a bot? I was just saying that I had the same issue. Commented Nov 26 at 9:28
  • 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. Commented Nov 26 at 16:31
  • 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. Commented Nov 27 at 15:57
  • 1
    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. Commented Nov 29 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.