Version 5.56 | Index Print view


FAQ: Word

Search:

How do I use ActiveBarcode control with Word?
Place your cursor where you want to add a barcode into your document. Then select "Insert" from the main menu and select the menu item "Object". A dialog box containg a list of controls opens. Select "ActiveBarcode" here and click OK. A barcode will be created into your document. 
To change the barcode, click directly into the barcode with the right button of your mouse. Now a pop up menu display and you select "Properties" (for the property dialog of Word) or "ActiveBarcode/Properties" (for the property dialog of ActiveBarcode). There you can adjust the barcode.
BTW: You can solve nearly all problems and automate tasks with ActiveBarcode and Visual Basic for Applications (VBA). For example see the below mail-merge macro.

The control is not visible and it displays {CONTROL BARCODE.BarcodeCtrl.\s} What is wrong? Why can I not see the barcode as it should look?
This is because of your options setting in Word. Go to the options dialog of Word ("Tools/Options"). Then have a look for the option "Field functions" and set this one to "not checked".

Mail merge with ActiveBarcode?: I want to add a barcode to my mail merge. How can I bind a data field of my control data to ActiveBarcode?
You have to use a macro to print your mail merge. This macro has to make the binding. The following example shows how you can do this. Have a look at the red highlighted "Productcode". This is the name of the data field bound to ActiveBarcode in this example. Please replace with your data field name. 
--------
Sub MailMerge_example_with_ActiveBarcode()
'
' MailMerge_example_with_ActiveBarcode Makro for Word2000
' (c) 1999 by Frank Horn
'
' Macro shows how to print barcodes in a mail merge.
if MsgBox("Do you want to print mail merged documents?", vbYesNo,
"Question") = vbYes Then
  'counter to zero
  num = 0
  'first record is number one
  ActiveDocument.MailMerge.DataSource.ActiveRecord = 1
  Do
    ' Fill ActiveBarcode text property now
    ActiveDocument.Barcode1.Text = ActiveDocument.MailMerge.DataSource.DataFields("
Productcode").Value
    ' do not prompt for printing...
    Options.PrintBackground = True
    ' print page
    ActiveDocument.PrintOut
    ' recognize old record
    lastone = ActiveDocument.MailMerge.DataSource.ActiveRecord
    ' select next record
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
    'count
    num = num + 1
    ' check if there are new ones
  Loop While ActiveDocument.MailMerge.DataSource.ActiveRecord <> lastone
  ' notify user
  MsgBox (Str(num) + " pages printed!")
End If
End Sub
------
To start printing, launch this macro. Otherwise the barcode will not be updated.

ActiveBarcode in Word labels or tables: I want to add a barcode object to a label or a table. The problem is that I cannot position it inside the table or the label. The barcode always "jumps" to the outside. How can I fix this problem?
If you add a barcode to a document the default for the "over the text" option of objects is always enabled. If this option is enabled you cannot position an object inside the table or the label. To fix this problem you have to disable this option. Click the object with the right mouse button and select the function Object format... A dialog will appear. Please select the "Position" tab and you'll see the "over the text" property at the bottom of the options. Disable this option and click Ok. Now the barcode is movable into the table and/or label.

Barcodes are not printed correct with Word: I can't get the barcode to print anything but a black rectangle unless I make it huge. What's the problem?
This was a problem of an earlier version of ActiveBarcode. Please go to the download menu and download the latest version of ActiveBarcode.

Change barcodes content automatically before printing: We would like to add a barcode to our letters. This barcode should be automatically added into every letter. How does this go?
You first add the ActiveBarcode control element into your document. Position the bar code by your wishes and set the basic properties as for example the type and the font size.

You find tips to insert the control element in a Word document in our examples: /howto/word.html. On this page you also find a link to a Flash video.

To automatically update the barcodes content before printing we 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 wishes. In this example the current date is simply encoded. Here you can change the text property to other single or compound data.

Both procedures "FilePrint" and "FilePrintDefault" intercept the printing process, both call "SetBarcode" and continue the printing process.

Macro: Adding the control: How can I create the barcode control using a VBA macro? For example to place a barcode on a document.
Use the following code to create a barcode at the cursors position:
 Set ab = Selection.InlineShapes.AddOLEObject(ClassType:="BARCODE.BarcodeCtrl.1",
FileName:="", LinkToFile:=False, DisplayAsIcon:=False)
To access the standard properties, you can use the variable ab now:
e.g. ab.width=200

To access the controls properties and methods, you have to do the following:
 With ab.OLEFormat
.Activate
Set abobject = .Object
End With
abobject.Text = "987698769812"
Now you can access the properties using the abobject variable.





| Home | Shop | Email | Datenschutz | Sitemap | © Lars Schenk & Frank Horn

All trademarks and product names mentioned are the property of their respective owners.

ActiveBarcode:
Barcode OCX and Software
The complete solution for all popular barcode types
www.ActiveBarcode.com