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 barcode 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
' Now launch printing:
End Sub

Sub FilePrintDefault() ' replaces defualt printing (no dialog)
' Sets the barcode content before printing
' 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.

| Home | Shop | Download | Email | Privacy policy | Imprint | Version 6.8.0
Copyright © Frank Horn & Lars Schenk
All trademarks and product names mentioned are the property of their respective owners.

We use cookies to provide you with the best experience and functionality on our website. By using our site you agree to this. read more >