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.

Video: Barcodes in Word Documents and Serial Letters

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 Bar Code

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.

Bar Code Data Does Not Change

Layout Options

The barcode must be inserted in the layout options (Format Object) always as „In line with text“. The option „In Front of Text“ is not supported for Mail Merge.

For flexible bar code positioning, you can insert the barcode into a freely positioned text box.

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.

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:

Using Word Programmatically Within 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 (
Usage of the Add-In is only permitted in intranet applications (according to site or enterprise license).