Word FAQ

Barcode not modifiable?Link
Why can't I change the barcode, move it or resize it?
To be able to edit the barcode object, you must activate the design mode.
Use this button to switch to design mode:
Design mode
Then you'll be able to change the barcode by clicking the barcode with the right mouse button.
I cannot change the barcode once I have closed the document.Link
I created a document with the barcode object, saved it and then closed it. The next time I open it, I cannot change the barcode object.
This has something to do with the security settings of your Office, Excel, Access or Word installation.
The ActiveX component is blocked by the security settings when opening the file.
You can change this by openning the document from a trusted location:

1. Click the Microsoft Office Button and then click on the Options button.
2. Click Trust Center, click Trust Center Settings, and then click Trusted Location.
3. Add the path of your document file to the trusted locations.
Barcode in Word tables and labelsLink
A barcode cannot be inserted into a table or label. The barcode always appears outside the table or label.
If you want to insert the barcode into a table or a label, the default setting is that a new object is always placed "over the text". This means that the barcode cannot be dragged into a table. It always jumps above or below the desired position. Perform the following steps to remedy the situation:
Right click on the barcode. A menu appears and you select "Format Object..."
A dialog appears; click on the "Position" tab here.
The field "Put over text" must not be selected so that the barcode can be placed in a table.
{CONTROL ACTIVEBARCODE.BarcodeCtrl.\s}Link
The control is not visible and it displays {CONTROL ACTIVEBARCODE.BarcodeCtrl.\s}
This happens because of wrong settings in Word. Go to the options dialog of Word and change the setting of "Field functions" to not active. Then the barcode will be displayed correctly as an image and not as a "field function".
Change the barcode text with a VBA macroLink
How can change the coded text of the barcode with a VBA macro?
Use the following command to change the text of a barcode:
ActiveDocument.Barcode1.Text = "12345"
Here it is assumed that the barcode object has the designation "Barcode1".
Change barcodes content automatically before printingLink
We would like to add a barcode to a letters. The barcode should be automatically added into every letter.
You first add the ActiveBarcode object into your document. Position the barcode and set the basic properties.
Check out the step by step guide to insert the barcode object into a Word document.
To automatically update the barcodes content before printing use a VBA macro:
Private Sub SetBarcode()
'Set the barcodes content (text property)
Barcode1.Text = Date
End Sub

Sub FilePrint() ' replaces normal printing via dialog
' Sets the barcode content before printing
SetBarcode
' Now launch printing:
Dialogs(wdDialogFilePrint).Show
End Sub

Sub FilePrintDefault() ' replaces defualt printing (no dialog)
' Sets the barcode content before printing
SetBarcode
' Now launch printing:
ActiveDocument.PrintOut Background:=False
End Sub
In the function "SetBarcode" you can customize the contents of the barcode according to your needs.
In this example the current date is encoded. But you can change the text property to any data as desired for your workflow.

Both procedures "FilePrint" and "FilePrintDefault" intercept the printing process, both call "SetBarcode" and continue the printing process.
Adding a barcode object with a VBA macroLink
How to place a barcode automatically in a Word document using a VBA macro?
Use the following code to create a barcode at the cursors position:
Set ab = Selection.InlineShapes.AddOLEObject(ClassType:="ACTIVEBARCODE.BarcodeCtrl.1", FileName:="", LinkToFile:=False, DisplayAsIcon:=False)
To access the properties, you can now use the variable ab like this: ab.width=200
To access the properties and methods use code like this:
With ab.OLEFormat
.Activate
Set abobject = .Object
End With
abobject.Text = "987698769812"
Now you can access the properties using the abobject variable.
We have an extensive documentation to show how to use the barcode object with VBA..
Barcodes in Word label sheetsLink
How can I use Word to print a sheet of labels with barcodes that have consecutive numbering?
Use this simple VBA macro, which you can use as a basic framework and adapt to your needs:
Sub barcodelables()
' Create a lable sheet and automatically add barcodes to the lables.
'
' 1. Create label sheet:
' Use a sheet with 8 labels. Use name to select the sheet.
'
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="Herma 4626", Address:="" _
, AutoText:="ExtrasEtikettenErstellen1", LaserTray:=wdPrinterManualFeed
'
' 2. for loop to create 8 barcodes:
'
For i = 1 To 8
' Create a barcode:
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Set ab=Selection.InlineShapes.AddOLEObject(ClassType:="ACTIVEBARCODE.BarcodeCtrl.1", _
FileName:="", LinkToFile:=False, DisplayAsIcon:=False)

With ab.OLEFormat
.Activate
Set ab = .Object
End With
'
' 3. Set the text of the barcode:
' This can also be a dynamic serialnumber.
'
ab.Text = "987698769812"
'
' Next lable.
'
Selection.MoveRight Unit:=wdCell
Next i
End Sub
Security warning when opening Office 2003 documentsLink
I get security messages when opening Word or Excel documents under office 2003. How can this be avoided without lowering the security level?
Unfortunately, there is no such elegant solution for Office 2003 as for later versions with trusted locations. Nevertheless, it is possible to stop the query in general for ActiveX controls in Office 2003, by inserting a key into the Windows Registry. Note, that this solution is not only for ActiveBarcode but for all ActiveX controls.
The registry entry reads:

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security]
"UFIControls"=dword:00000001

We recommend to perform a backup before you change the registry.