Skip to content

Easily create QR Codes in Word

G16th May 2018

C8 Comments

TExcel, 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}
  • MERGECODE is the Microsoft field syntax that activates the barcode generation.
  • Barcode is the parameter from the mail merge that contains the barcode string.
  • QR indicates that a QR code is to be generated.
  • The \s switch specifies the scaling factor in percent.
  • The \h switch specifies the height, in TWIPS (567 twips = 1 cm)
  • The \f switch specifies the foreground colour (in this case I chose a lovely blue: Hex 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).


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.



8 responses to “Easily create QR Codes in Word”

  • Written by Cecil on 30 October 2018:

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

  • Written by Alfred on 12 November 2018:

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

  • Written by JohnB on 24 January 2019:

    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 –>

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

    or use mailmerge with Excel such as

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

    • Written by Adam Dimech on 29 January 2019:

      Hello John,

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

    • Written by Pedro on 23 July 2019:

      Thank you!!!

  • Written by Ahmed on 6 February 2019:

    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.

  • Written by Julien on 14 June 2019:

    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?

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.