FAQ

Search:

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 name "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.

There is a example file available in our download section.

| Home | Shop | Download | E-Mail | Privacy Policy | Imprint | Version 6.5.0
Copyright ©
Frank HornActiveBarcode Generator
Web design: szBubble 3.1.12.318
Copyright © Frank Horn
&
Lars SchenkActiveBarcode Object
Web- & server component
Command line
Copyright © 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 >