To create a QR code for each recipient in a Word mail merge, insert a DISPLAYBARCODE field that uses a merge field as its data, then finish the merge and update the barcode fields. In Word for Microsoft 365 on Windows, the basic field looks like { DISPLAYBARCODE "{ MERGEFIELD QRLink }" QR \q 3 }; create the braces with Word’s field shortcut rather than typing them.
How Word Creates a QR Code
Word can display a barcode from a field code. The DISPLAYBARCODE field tells Word what content to encode and what kind of barcode to create. In this case, QR specifies a QR code, and the nested MERGEFIELD supplies a different value for each record in your mailing list. For example, a list might contain a separate event-registration URL for each attendee.
This is not the same as inserting a static picture of a QR code. A static picture stays the same for every recipient; a barcode field can be recalculated using each person’s merge data. The merge field must resolve to usable text, such as a complete web address beginning with https://. The code represents that text; it does not automatically create a personalized web page or verify that a link works.
The \q 3 switch sets the QR error-correction level. Higher error correction can help a code remain readable if it is partly obscured, but it can also make the pattern denser. For ordinary printed labels or letters, start with the default size and test the result rather than assuming the highest setting is always best.
Prepare the Mail-Merge Data
Before building the Word document, prepare a column in your data source for the exact content each QR code should hold. If the source is an Excel workbook, give the column a clear heading such as QRLink, put one value in each recipient’s row, and save the workbook before connecting it to Word. Keep the values as plain text so the merge does not unexpectedly alter characters or formatting.
For example, a small recipient list could have a Name column and a QRLink column. The first person’s value might be https://example.org/register?id=104, while the next person’s value might end in id=105. When Word merges the records, those different values should produce different QR codes.
- Use complete, tested links rather than a bare domain or a link that only works while signed in to your own account.
- Check for blank cells, spaces at the start or end, and accidental line breaks. These can result in empty codes or links that do not scan as intended.
- Make sure every record is assigned the right value. A QR code can be technically readable but still lead to the wrong person’s page.
- Do not put confidential details in the code simply because it is printed on a private letter. Anyone who can scan the code may be able to read its encoded text.
In Word, connect the document to the list through Mailings > Select Recipients. Choose an existing list and select the workbook and worksheet that contain your records. Use Mailings > Edit Recipient List to check that the expected rows are included. In the preview, confirm that the merge fields show the right data before adding the barcode.
Insert the DISPLAYBARCODE Field
First, place the insertion point where the QR code should appear in the mail-merge layout. A table cell is often useful for labels or cards because it gives the code a defined area and helps keep it aligned with nearby text. On Windows, press Ctrl+F9 to insert a pair of field braces. Do not type ordinary curly braces: Word recognizes the special braces created by the shortcut as a field.
Inside the braces, type DISPLAYBARCODE ". Then use Mailings > Insert Merge Field to insert the column that contains the QR data, such as QRLink. Finish the field by typing " QR \q 3 after the merge field. The completed structure should resemble this, with the merge field itself inserted as a real Word field:
{ DISPLAYBARCODE "{ MERGEFIELD QRLink }" QR \q 3 }
Do not type the inner braces around MERGEFIELD either. Insert that field from the Mailings ribbon so Word treats it as a merge field. If you already know how to insert Word fields, you can use the relevant field command, but using the ribbon helps ensure that the field name matches the column in the connected data source.
To inspect or edit field codes, press Alt+F9 on Windows to switch between field codes and their displayed results. Press it again to return to the result view. If the code appears as ordinary text, check that the outer braces are actual field braces and that you have not accidentally inserted a text box or typed the whole example as plain text.
Preview and Complete the Merge
Use Mailings > Preview Results to move through several records. This is a useful check of the names and surrounding layout, but do not rely on the preview alone to confirm that every barcode has refreshed. Create a merged document with Mailings > Finish & Merge > Edit Individual Documents. Choose all records or the range you need. Word creates a new document containing the merged results.
In the new merged document, click in the document body and press Ctrl+A, then press F9 to update fields. On some keyboards, you may need to hold Fn as well as F9 to send the function-key command. Updating the fields after the merge lets the barcode field use the value resolved for each recipient. If the document is long or contains other fields, check the results afterward, since updating fields can also refresh items such as dates and page references.
For a single-record test, select one recipient in the recipient list, finish the merge to a new document, update the fields, and scan the result. Once the code and layout are confirmed, make the full merged document. Keep the original mail-merge main document connected to its data source; the merged output is the document intended for final checking, printing, or saving as a separate file.
Size, Layout, and Print Testing
A QR code can scan on screen and still fail on paper if it prints too small, is blurred, or is crowded by nearby design elements. Leave clear space around the code so its edges are not touching text, rules, or the edge of a label. Avoid stretching the code unevenly to fill a shape: distortion can make the square pattern difficult for a phone camera to read.
Print a sample on the actual printer and stock you plan to use. Test it with more than one phone if possible, and scan from the normal distance a recipient is likely to use. Confirm not only that the phone recognizes the code but that the destination is correct and the page opens without an unexpected login or permission request. A successful scan is not proof that the content is appropriate or that the destination will remain available.
- Use a high-contrast design, usually a dark code on a light background.
- Keep the code square and large enough for the amount of information encoded. Longer URLs create more complex patterns and may need more print area.
- Do not place a logo over the code unless you have tested the resulting print carefully; covering modules can reduce scan reliability.
- Check the first, middle, and last records in a large batch, especially if their URLs vary in length.
Common Problems and Fixes
The code does not appear. Switch to field-code view with Alt+F9 and inspect the outer field. Confirm that the braces were inserted with Ctrl+F9, the field begins with DISPLAYBARCODE, and the barcode type is written as QR. Then update the field with F9. If the result still does not display, verify that your desktop version of Word supports the barcode field and that the document is not being viewed in an application with different field support.
Every recipient gets the same code. Check that the nested merge field is the data field inside the barcode field, not a fixed URL typed between the quotation marks. Also confirm that the connected worksheet has distinct values and that you are viewing the merged output rather than repeatedly looking at the same source record.
The code shows a field error or encodes the wrong text. Make sure the quotation marks around the data are balanced and that the merge-field name matches the source column. Remove stray spaces or line breaks from the source value, then create a fresh merged document and update the fields. If a URL contains characters such as an ampersand, keep the source value intact; do not replace or remove URL characters merely to make the field code look simpler.
The code scans but the link fails. The barcode is only encoding the supplied text. Test the URL directly in a browser, check that it includes the intended protocol, and confirm that recipients have permission to open the destination. Shortened links may make a simpler code, but they add another service and can make the final destination less obvious to the recipient.
Word for Mac and Other Options
The instructions above use Word for Microsoft 365 on Windows. Word for Mac has different keyboard behavior, and function keys may require the Fn key or a change to macOS keyboard settings. Field-code support and rendering can also vary by Word version. If the shortcut does not insert a field on your Mac, consult the Word version’s field-insertion help rather than typing braces as text; if the barcode field does not render correctly, complete and verify the merge in Word for Windows before printing.
Other approaches include a trusted Word add-in or generating QR-code image files outside Word and placing them into the document. These can be useful when you need design controls that the field does not provide, or when your Word version cannot render the field. However, a static image must be matched to the correct recipient, which can introduce mix-ups in a large batch. Before using a third-party QR generator, consider whether its service receives the URLs or personal data in your list. The built-in field avoids sending the data to a separate QR website, though the document and its data source still need appropriate handling.
Privacy and Safe Use
Think of a QR code as printed text in a machine-readable form, not as a secure container. A code containing a personal URL or an identifier can be copied, photographed, or scanned by anyone who sees it. Encode only what the recipient needs, and use a destination with suitable access controls when the linked information is private. Do not assume that making a link difficult to guess is equivalent to protecting sensitive data.
For public-facing campaigns, use a destination you control and plan to maintain. If you later change the destination, a printed QR code will still contain its original text unless the URL points to a redirect that you control. This is one reason to test a small batch, confirm ownership and permissions, and retain a copy of the exact source data used for a mailing.
Frequently Asked Questions
Can Word create a different QR code for each mail-merge recipient?
Yes. Put a different QR value in each data-source row and use that column as the nested MERGEFIELD inside the DISPLAYBARCODE field. Finish the merge and update the barcode fields in the merged document.
Do I need Excel to create the QR codes?
No. Word creates the QR code from the value in the merge field. Excel is simply one possible source for the recipient list; another supported mail-merge data source can provide the QR content if Word can connect to it.
Why does the QR code look like field-code text?
Word may be displaying field codes instead of their results, or the braces may have been typed rather than inserted as field braces. Toggle field-code display with Alt+F9 on Windows, check the field structure, and update it with F9.
Can a QR code contain plain text instead of a web link?
Yes. The barcode field encodes the text supplied to it; it does not require a URL. A phone may handle plain text differently from a web address, so test the code with the devices and scanning apps your recipients are likely to use.
Will the QR codes update if I change the spreadsheet later?
The original mail-merge document can use updated source data when you reconnect or refresh the recipient list and run the merge again. A merged output document contains the results from the merge you already made; it is not a live link that automatically regenerates when the workbook changes.
Related
- Excel Timesheet Free Copy: Find and Use a Template
- Excel Invoice Copy: How to Duplicate and Reuse Invoices
- Excel Timesheet: How to Add Up Hours Correctly
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Insert a Dropdown in Google Sheets: A Quick GuideTo insert a dropdown in Google Sheets, select the cell or cells, choose Insert > Dropdown, add your…
- Can You Insert a Horizontal Line in Word?Yes. In Microsoft Word for Microsoft 365 on Windows, you can insert a horizontal line from Home >…
- How to Remove Bullet Formatting in WordTo remove bullet formatting in Microsoft Word, select the bulleted paragraphs, then go to Home > Paragraph >…
- Google Sheets Conditional Formatting: How to Add RulesTo add conditional formatting in Google Sheets, select the cells, choose Format > Conditional formatting, set a condition…
- How to Create Rules in Outlook: Setup, Tips, and FixesTo create a rule in Outlook, select a message and choose the option to create a rule, or…
- Outlook Calendar Share Request: How to Send and Manage OneTo share your Outlook calendar, open Calendar, choose Share Calendar or Share, enter the recipient, set their permission…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.