Skip to content

Dear Internet Explorer user: Your browser is no longer supported

Please switch to a modern browser such as Microsoft Edge, Mozilla Firefox or Google Chrome to view this website's content.

Easily create QR Codes in Word

Did you know that it is possible to generate fully-functional QR codes in Microsoft Word using mail merge without the need for third-party plugins?

QR codes offer many advantages over the traditional line-type bar codes that have been in use for the last three decades, including better readability.

An industry has developed around supplying users with expensive QR code plugins for Microsoft Office programmes that rely on Visual Basic or ActiveX to work. Unfortunately, most of these utilities are clunky and require many steps to produce a single bar code.

In my line of work, I need to produce thousands of bar codes and I don’t have the time to craft them all by hand. As it turns out, Office 365 (ie the latest version of Word) has a native capacity to generate QR codes without the need to pay for additional plugins. Best of all, I can generate thousands of QR codes from an Excel spreadsheet using a familiar mail merge function which saves me lots of time.

This procedure describes a method for producing stickers in Microsoft Word that contain QR codes. I will assume that users have a basic understanding of how to use mail merge in Word from an Excel file. (If not, here is some basic help).

Part 1: Prepare your mail merge

The first step to creating the bar codes is to generate a database in Microsoft Excel. List all of your bar codes in a column. Populate other columns with pertinent information about whatever it is that you are bar-coding. Save your Excel sheet.

Screen capture of Excel sheet showing bar code data.
Create an Excel sheet that lists the bar codes and other relevant information that will be used on your labels.

In Microsoft Word, Create your sticker template and link this to your Excel sheet by going to Mailings > Select Recipients > Existing List…

Screen capture of Microsoft Word mail merge menu command.
Use Microsoft Word’s mail merge function to connect your template to your Excel spreadsheet.

Add field codes for your stickers as required, via Mailings > Insert Merge Field and then choosing fields accordingly. (Click on Preview Results to preview).

Screen capture of Microsoft Word mail merge tools.
Create your mail merge template by adding fields via Mailings > Insert Field.

Don’t forget to add a Next Record rule before each new label (except the first) via Mailings > Rules > Next Record. Do this until an entire page is filled (only one template page is required for mail merge).

Screen capture of Microsoft Word mail merge commands.
Add a “next record” rule between each new label.

Part 2: Adding QR codes

Now that the template is finished, we can add the QR codes. Adding QR codes is relatively easy because of the MERGEFIELD parameter, but requires a little bit of syntax. (Unfortunately MERGEFIELD cannot be inserted via any of the menu commands in Word).

In Microsoft Word, place your cursor where you want the first QR code to be positioned. Press Ctrl and F9 to insert a pair of empty field braces.

Screen capture of Microsoft Word showing empty field braces.
Press Ctrl + F9 to add a pair of empty field braces where the bar code is to go.

Type the following into the field where Barcode is the bar code string field from your mail merge:

{MERGEBARCODE Barcode QR \s 70 h\ 100 \f 0xC7751B}

The QR code can be customised with additional parameters, including \b for a background colour and \t for the bar code string to be printed with the bar code.

Refer to the MSDN website for more information.

Screen capture of populated curly braces field in Microsoft Word.
Populate the empty field braces with the QR code formula.

Right-click and press “Update Field” so that the field changes to show <<Barcode QR Code>>.

Screen capture of Microsoft Word.
Right-click on the new field and choose “Update field” to activate the new QR code.

Continue with this process until the template has been filled with bar codes. Press “Preview Results” to preview and refresh.

Screen shot of Microsoft Word document with QR codes.
Fill the entire template with QR codes as required.

Save your template file. When you are ready to print your labels, go to Mailings > Finish and Merge… > Print Documents. (Do not choose File > Print).

Options

As suggested earlier, the QR codes that are produced are highly-customisable both in terms of size and colour. The MSDN website provides other additional switches that can be used to adjust the appearance of your QR codes. Alternatively, right-clicking on a QR code and choosing “Edit Barcode” will provide various options. By examining the resultant field codes, these styles can be applied across the entire sheet.

Screen capture of a dialogue box in Word.
The appearance of QR codes can also be updated with a dialogue box that will generate the approriate field tags and flags.

An astute eye would observe that this approach can be used to produce not just QR codes, but many other types as well, including the common Code 128 type.

Most significantly, this was achieved using the built-in capability of a current version of Microsoft Word without the need for third-party add-ins, software or fonts.

   

Comments

18 responses to “Easily create QR Codes in Word”

On 30 October 2018, Cecil wrote: Hyperlink chain icon

Wherever there’s an abundance of money and individuals stability is a perfect
matter.

Reply

On 12 November 2018, Alfred wrote: Hyperlink chain icon

I am so happy to find this post. Very useful and simple instructions are given.
A big thanks for your sharing.

Reply

On 24 January 2019, JohnB wrote: Hyperlink chain icon

The command in this article is only for Word2010 and does not work in newer versions.
After struggling for 2 days trying to get it to work, just found a new command for Word 2013.

See –> https://msdn.microsoft.com/en-us/library/hh745901(v=office.12).aspx

{DISPLAYBARCODE “text here in quotes” QR \q 3}

or use mailmerge with Excel such as
{DISPLAYBARCODE {MERGEFIELD Field2} QR \q 3}

Combining the new code – with knowledge gained from your page made quick work of my problem.

Reply

    On 29 January 2019, Adam Dimech wrote: Hyperlink chain icon

    Hello John,

    This article was written for the latest version of Word in Office 365, rather than older versions. Glad you sorted it out.

    Reply

    On 23 July 2019, Pedro wrote: Hyperlink chain icon

    Thank you!!!

    Reply

    On 1 October 2019, Bill wrote: Hyperlink chain icon

    Thanks for that! The mail-merge form also needs to have quotes around it. This worked for me in Word 2016:
    { DISPLAYBARCODE "{MERGEFIELD VIN}" QR \q 0 \s 200 }

    Reply

On 6 February 2019, Ahmed wrote: Hyperlink chain icon

This is such a great article I was looking for.

But I am missing one part here, how do you get the barcode string?

Would appreciate if you help.

Reply

On 14 June 2019, Julien wrote: Hyperlink chain icon

Thank you Adam explaining this very useful hidden feature.
On your example, you have textual fields on the left column and the QR on the right, like if you have multi column inside your label area. How did you manage this?

Reply

On 17 August 2020, Salih Tahir wrote: Hyperlink chain icon

Hello, thanks for this most useful post. I was wondering where the numbers in the barcode column are coming from. Are they generated within Excel, and how do we make sure that they redirect to the URLs that we need? Do I need to have created the QR Codes one by one manually within Excel (or within MS Word)? Or do I simply write one URL in each row in the Barcodes column? Thank you in advance for your response.

Reply

On 25 August 2020, Parminder wrote: Hyperlink chain icon

it is an awesome tutorial, thank you so much!!

Reply

On 8 March 2021, Adriana wrote: Hyperlink chain icon

Thank for this article, after spending many hours trying to create mailmerge labels with QR codes, I finally came across this page and worked first go. Thank you. I’d appreciate if you could please advise how i can change the colour to black, thank you

Reply

On 6 April 2021, Bert wrote: Hyperlink chain icon

Thank you for the really handy tutorial!

Reply

On 4 November 2021, Paul wrote: Hyperlink chain icon

Press Ctrl + F9 to add a pair of empty field braces where the bar code is to go

I’m using Office 365 on a Mac. Can’t figure out how to get an empty braces to work. Typing the characters doesn’t do it.

«Name»
«Address1»
«Address2»
«Address3»
«Postcode»

Dear Mr

{MERGECODE «url» QR \S 70 H\ 100 \F 0XC7751B}

Reply

On 5 January 2022, Nasep wrote: Hyperlink chain icon

How to add more than one field in Word for example {mergebarcode field1 field2 field 3 QR } ? Thank you

Reply

On 24 February 2022, Dr. Guillory wrote: Hyperlink chain icon

Now that I can scan them, what software can be used to gather all those badges that I will scan and now have a list of? That is what I really need in lieu of printing tickets and having a long line at the banquet (ballroom entrance)–hence, BOTTLE NECKING.

Reply

On 22 March 2022, Kaj Engberg wrote: Hyperlink chain icon

Super valuable post and comments. Using Word 365 (Windows), I found the following to work for my situation.

I wanted:
1. A unique QR code that was the variable “SurveyURL” in the code below
2. The QR code to be ~1 inch square (2.6 cm)

What I learned:
For the URL to “work” in Word and create the QR code, the URL couldn’t have any spaces. For example, my “original” URL from Excel was:
https://customerfeedback.abcco.com/jfe/form/SV_bJi0jnNkM5LpQQS?Num=123456&Add=123 HANOVER RD FLORHAM PARK, NJ 07932

For the URL to work, it had to have no spaces:
https://customerfeedback.abcco.com/jfe/form/SV_bJi0jnNkM5LpQQS?Num=123456&Add=123%20HANOVER%20RD%20FLORHAM%20PARK,%20NJ%2007932

DISPLAYBARCODE “{ MERGEFIELD SurveyURL}” QR \s 45 \h 1000

Reply

On 16 February 2024, Dan wrote: Hyperlink chain icon

I have tried the original code and the alternative codes. I am using O365.

Everything on my mail merge works correctly except for the QR code. It shows the QR code in the right format but always shows the very first QR code from the first record…it never changes to Next Record when the rest of the data changes.

I am using table that is 3 columns wide and 3 columns deep and the data and the QR code are both in the same cell.

Any ideas?

Reply

Have Your Say

The following HTML is permitted:
<a href="" title=""> <b> <blockquote cite=""> <code> <em> <i> <q cite=""> <strike> <strong>

Comments will be published subject to the Editorial Policy.