Share via

Can't display a QR code when using Mail Merge in Microsoft Word (DISPLAYBARCODE/MERGEBARCODE)

Anonymous
2019-11-19T11:02:21+00:00

I want to use the Mail Merge function in Word to generate name badges to a conference. (Office 365, Word as a local desktop app under Windows.) The data is supplied in an Excel file. One of the fields should be displayed as a QR code.

I found some documentation about the DISPLAYBARCODE and MERGEBARCODE field commands and some great instructions on exactly how to do this. I followed this one:

https://hubpages.com/technology/Mail-Mergeable-Barcodes-in-Microsoft-Word-2013-aka-Bar-Codes

In the screen dumps below, you see what it looks like when (a) showing internal field codes (b) hiding internal codes without Preview Results and (c) with Preview Results.

(a) is exactly as the instructions in the link - with the field expression { DISPLAYBARCODE "{ MERGEFIELD QRcode }" QR \s 100 \q 3 } (b) displays the QR code. But in (c) (or when choosing "Finish & Merge") I get an error: "Data length is not supported by current type".

The QR data is blank - it seems like it isn't possible to make a MERGEFIELD reference inside DISPLAYBARCODE. But it should work according to the link above - and the QR code is displayed in (b).

There are other links recommending using MERGEBARCODE instead:

https://superuser.com/questions/1010960/use-a-mergefield-as-data-for-a-displaybarcode-field

https://support.office.com/en-us/article/field-codes-mergebarcode-812fc43f-cb53-4782-8f9f-290ed08d34f3

I've tried this - using the field expression { MERGEBARCODE QRcode QR \s 100 \q 3 } It is accepted (displayed as «QRcode QR code» in the (b) view), but nothing is shown in the (c) view (or when "Finish & Merge").

I would be VERY grateful if you can help me! :-) Maybe I just need to adjust the syntax. But I've tried all the alternatives I can think of...

PS. Another user having the same problem: https://answers.microsoft.com/en-us/msoffice/forum/all/qr-codes-from-access-2013-using-mail-merge/8176e7e1-8f4b-4afe-81d0-8e343c82edc4

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-11-21T14:56:30+00:00

Thank you very much for your offer to look at the files, Doug and Charles. :-) 

The problem is solved. It had nothing to do with DISPLAYBARCODE, so I was on a wild goose chase. :-( I was using label printing in Word, with four labels on one page. And I put the QR-code in a textbox so I could position it better. But Word somehow connected the textbox to the wrong label on the page, so it referenced another (empty) row in the Excel file. To learn from this: Be careful when using textboxes in a Word document with several records/labels on the same page.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323K Reputation points MVP Volunteer Moderator
    2019-11-22T04:57:16+00:00

    The use of textboxes is almost always completely unnecessary.

    The only time I use them is when I want to link one to another so that the text inserted in one will flow to the other if required.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Charles Kenyon 167.5K Reputation points Volunteer Moderator
    2019-11-19T13:25:06+00:00

    You can save your primary merge document and a sample data document on OneDrive or DropBox and post a link here. I suspect your data.

    Note that there is a mergebarcode field that you could use instead.

    https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/cc4b13c2-c09b-4545-a6ae-4509d943233e

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Doug Robbins - MVP - Office Apps and Services 323K Reputation points MVP Volunteer Moderator
    2019-11-19T11:42:55+00:00

    If you send me a copy of the mail merge main document and the data source, referencing this thread in the covering email message, I will investigate the issue.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments