Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Add a live QR code inside a Word document with the DISPLAYBARCODE field
Automation

Add a Live QR Code in Word

Use the native DISPLAYBARCODE field in Word to embed a real, updatable QR code that links to lucaberton.com β€” no add-in required.

LB
Luca Berton
Β· 3 min read

A QR code on a printed handout, a certificate, or a course sheet is one of the simplest ways to send readers straight to a website. You can paste a static QR image into Word, but there is a cleaner option: let Word generate the barcode itself from a field. That way the code always reflects the URL you typed, and you can update it with a single keystroke.

This is how I embed a live, updatable QR code that points to lucaberton.com in any Word document.

Why a field instead of a picture

A pasted QR image is frozen. If you change the link, you have to regenerate the image somewhere else, re-import it, and replace the old one. The DISPLAYBARCODE field renders the barcode directly inside Word from the text you give it, so the source of truth stays in the document.

The field is native to Word for Windows β€” no add-in, no macro, no third-party tool. It is part of Word’s field system, the same machinery behind page numbers and cross-references.

The field syntax

The instruction that drives the barcode is a Word field. In its simplest form you point it at a URL and tell it to use the QR symbology:

DISPLAYBARCODE "lucaberton.com" QR

The first argument is the data to encode. The second is the barcode type β€” QR for a QR code. Word also accepts switches for error correction and version; a practical default is high error correction so the code still scans when printed small or slightly damaged:

DISPLAYBARCODE "lucaberton.com" QR \q 3

The \q 3 switch sets the QR error-correction level to the highest of the four (about 30 percent of the code can be lost and still scan).

Insert it in Word

  1. Place the cursor where you want the code β€” often a table cell, so it sits neatly beside your text.

  2. Press Ctrl + F9 to insert a pair of field braces { }. Do not type the braces by hand; Word treats typed braces as ordinary characters.

  3. Inside the braces, type the instruction:

    DISPLAYBARCODE "lucaberton.com" QR \q 3
  4. Select the field and press F9 to update it. Word draws the QR code.

If you prefer the menu, you can also insert it from Insert β†’ Quick Parts β†’ Field, choose DisplayBarcode, enter the address and the QR symbology, and finish with F9.

Updating the code

Because it is a field, the barcode refreshes whenever you update fields. Select the code and press F9, or press Ctrl + A then F9 to refresh every field in the document. Word also updates fields on print and on open if you have that option enabled, so a printed handout always carries a current code.

To change where it points, edit the text inside the field braces, then press F9 again β€” no image editing required.

Putting it in a table cell

A clean layout is to place the QR in one cell of a two-column table and your call-to-action in the other:

Scan to visit(QR code)
lucaberton.comDISPLAYBARCODE field

Readers scan the code on the right; the text on the left tells them where it leads. This is the structure I used for the companion Word document in this series.

Practical notes

  • DISPLAYBARCODE renders in Word for Windows. Other editors such as LibreOffice or Google Docs may show the field’s text placeholder but will not draw the barcode, so generate and print from Word.
  • Keep the encoded URL short and canonical. For a personal site the bare domain works well: lucaberton.com.
  • High error correction (\q 3) costs a little density but pays off on printed material.
  • Always select the field and press F9 before you print or export to PDF β€” an unupdated field can show the placeholder instead of the code.

That is the whole technique: a native Word field, a URL, and F9. No images to manage, no tools to install β€” just a live, updatable QR code that takes readers straight to lucaberton.com.

#Microsoft Word #QR Code #DISPLAYBARCODE #Office Automation #Tutorial
Share:
Ansible & Python Training

Need help with Ansible & Python Training?

Level up your automation skills with expert-led Ansible and Python training.

Learn more about Ansible & Python Training

Want to operate this yourself, in production?

Take the free AI Platform Engineer Readiness Scorecard to see which skills transfer β€” then build a production-shaped AI platform in the 4-week Bootcamp.

Take the Scorecard β†’
Luca Berton β€” AI & Cloud Advisor, Docker Captain

Luca Berton

AI & Cloud Advisor Β· Docker Captain Β· KubeCon Speaker

15+ years in enterprise infrastructure. Author of 8 technical books, creator of Ansible Pilot (1M+ YouTube views, 648K site users). Former Red Hat engineer. Speaker at KubeCon EU 2026 and Red Hat Summit 2026.

Free 30-min AI & Cloud consultation

Book Now