Field codes: DisplayBarcode - Microsoft Support (original) (raw)

Applies ToWord for Microsoft 365 Word 2024 Word 2021 Word 2019 Word 2016 Word 2013

DisplayBarcode is used to insert a standard bar code into a document. It supports 10 different types of barcode. Depending on the one you choose, the barcode type accepts alphanumeric data of different formats and lengths. As a field code, you can right-click and choose Toggle field codes to go between the code and the barcode image. See the example for several types of barcodes. For the specification, see 3.1.3.2.7 DISPLAYBARCODE.

Syntax

{ DisplayBarcode field-argument-1 field-argument-2 [ switches ] }

Field codes are not case sensitive.

Instructions

Each barcode may use its own data format, and so check some of the links if you're not sure what's needed.

To use DisplayBarcode in a document, follow these steps:

  1. Click or tap where you want the barcode.
  2. Press Ctrl + F9. You must do this, as just typing curly brackets {} won't work.
  3. Type DisplayBarcode plus arguments and switches. For example DisplayBarcode “http://www.microsoft.com” QR \q 3, which displays a QR code that links you to www.microsoft.com.
    A QR code of www.microsoft.com
  4. To see the barcode, right-click the Field code and select Toggle Field Codes.

Examples

Here are a few examples to get you going. Follow the steps above, and paste in the code here.

Code type DisplayBarcode syntax
QR code DisplayBarcode “http://www.microsoft.com” QR \q 3
EAN13 (with text) DisplayBarcode “490123456789” EAN13 \t
Code 39 DisplayBarcode “2345678” CODE39 \d \t
Code 128 DisplayBarcode “490123456789” CODE128 \t
UPCA DisplayBarcode "012345678901" UPCA \t \x
UPCE DisplayBarcode "123456" UPCE \t \x

See also

Field codes: MergeBarcode

3.1.3.2.7 DISPLAYBARCODE

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.