Inserting Barcodes into Microsoft Word Documents

To insert a bar code into a Microsoft Word document follow these steps:

  1. Switch to the Add-Ins tab.
  2. Open the TBarCode Panel.
  3. Select the barcode type (e.g. Code 128).
  4. Enter your barcode data.
  5. Adjust the size of the barcode (width, height, module width etc).
  6. Click the button Insert Barcode. Finished!
Insert Barcodes into Microsoft Word with TBarCode Office
Barcodes in Word Mail Merge

Inserting Barcodes into Serial Letters

Mail merge fields (e.g. the customer number) can be selected directly and then printed as barcode:

Use the button Insert Field... to encode the required merge fields in the bar code.

A demo of our serial letter functionality you will find in our TBarCode Office Video.

Font Tab Is Missing in Barcode Settings

This is because Office in 64 Bit version does not implement the font property page. A system dialog is used, which is not available in Office 64 Bit.

  • Open TBarCode Panel
  • Right click the barcode control
  • Select Properties from the context menu, you see a list of just name/value pairs.
  • Scroll down to the Font property and open/change it.

Video: Barcodes in Word Documents and Serial Letters

Barcode Word Add-In: Create Barcodes in Word

The first part of the video demonstrates how to insert bar codes into Microsoft Word 2007, 2010 and 2013. The second part of the video shows how to generate a bar-coded mail merge/serial letter using a recipient list.

For more videos visit our TBarCode Office Tutorial Channel!

How To: Create a Barcode Using the vCard Format

To create a vCard bar-code you have to enter the data using the correct data format. Below you can find some samples using the appropriate data structure.

vCard data structure sample:

TEL:+43 7252 72720
ADR:;;Wagnerstrasse 6;Steyr;;4400;Austria

vCard structure using mail merge data fields:

N: «lastname»;«firstname»
TEL: «phone»
EMAIL: «email»
URL: «url»
ADR:;; «address»;«city»;;«zip»;«country»

Here is a Word Barcode-Add-In screenshot with such merge fields:

TBarCode Office with vCard settings

Mail Merge Errors

Mail Merge Stops After Two Records with TXT or CSV Datasource

Solution: The data-file for the mail merge must be connected as "OLE DB Datasource".

Connect your data-file with Select Recipients and select your text or CSV file. In the Confirm Data Source dialog, select "OLE DB Database Files" and click OK.

If the Confirm Data Source dialog does not appear you have to enable it in the Word Options. Go to Word Options | Advanced | General and activate the option "Confirm file format conversion on open". Then reconnect your data as described above.

TBarCode Office with Word 2007 - Word Options

Fatal Error at MailMergeDataField.get_Value()

Access MDB Data Source: Please verify the table fields in your data source. The error can appear if a field name contains more than 32 characters. As a solution rename the fields in your import table or create a view with renamed fields.

Wrong Page Numbers in the Barcode

If your mail merge bar code references fields or document properties containing page numbers, wrong values can be read.

The behavior is caused by the internal update order in Word. It may occur that the bar code is created/drawn before the page numbers have been calculated (and an old value is read). Unfortunately we have no influence on this problem.

Barcode Data Doesn't Change When Using Mail Merge

The same barcode data is inserted when creating mail merge barcodes. To workaround this problem, try one of the following steps:

Preview Mode

  • In the preview mode the barcode is always shown using the data from the first record.
  • To get the correct barcodes please do a mail merge into a new document or directly to the printer.

Layout Options

  • The barcode must be insert in the layout options (Format Object) always as „In line with text“ („In Front of Text“ is partially supported since V10.8).
  • If you use other wrapping styles, the bar code is not recognized in a mail merge.
  • For flexible bar code positioning you can insert the barcode into a freely positioned text box or table.

Scaled or Cropped EMF Barcodes with Remote Desktop


If you connect to a PC through Remote Desktop, the EMF barcodes may look scaled or cropped after updating the bar codes. The problem occurs if you have scaled the size of text, apps and other items, that means the scaling in the Display Settings is set to 125% or higher.

Text or App Size Is Set to 125%
Example for a scaled size, which triggers the problem.


In order to fix the EMF bar code scaling, enable the following setting in Windows 10:

  • Right click on the desktop and select Display Settings.
    Alternatively open the Settings app, go to the System group of settings, then select the Display tab.
  • Scroll down to the Scale and layout section and click Advanced scaling settings.
  • On the following screen, below “Fix scaling for apps”, enable the Let Windows try to fix apps so they are not blurry switch:

Fix Scaling for Apps

After that restart Excel (or Word) and refresh the bar codes in your document: Press SHIFT + Refresh in the add-in panel to force a refresh of all bar codes.

No Barcode Visible / Cropped Barcode

TBarCode is inserted in Word as „Inline Shape“. In case of Inline Shapes, the shape is clipped if the line height is configured to a fixed value.

The barcode should be visible again if you adjust line spacing to "Single".

Barcode Control Blocked or Barcode Not Updated

Please verify your security settings.

Network Path

By default documents from a shared network path containing active content (such as barcode controls) are opened in a safe mode, where active content may be disabled. If you see a yellow security warning on top of your document, go to the trust center in Word and/or Excel and allow the network path you use.

Security Alerts

TBarCode Office is using ActiveX Controls for bar code creation. Depending on your security settings, ActiveX Controls may be blocked. If you see a yellow security warning on top of your document, you have to click "Enable Content" to allow access to the Barcode ActiveX Controls. The behavior of ActiveX Contols can be adjusted as shown below:

Barcode Shows "Adjust Properties"

Lost Settings After Saving the Document

Barcodes in a table can lose their settings when the document is saved. It seems the embedded Barcode ActiveX Controls are reset due to a Word bug. Customer reports show that the problem occurs in Word 2013 – but not with the latest service pack (15.0.4903.1002 or later).

Another reason for this problem can be that the document is opened and saved on a system where TBarCode/Office is not installed.


The solution is to update Office to the latest service pack or to re-install Office with the latest version. Make sure you edit the document always on a system where the add-in is installed and working properly.

How to: Use Microsoft Word Programmatically with IIS Applications

In order to make the Add-In work properly you need the following IIS application settings

  • Enable impersonation in the web.config file.
  • Configure the Anonymous Authentication Identity and change it to a specific user.
  • License the Add-In under the specified user account or ask for a user-independent license import (
Use of the Add-In is only permitted in Intranet applications (according to the terms of the site or enterprise license).