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
    ' Fill ActiveBarcode text property now
    ActiveDocument.Barcode1.Text = ActiveDocument.MailMerge.DataSource.DataFields("Productcode").Value
    ' do not prompt for printing...
    Options.PrintBackground = True
    ' print page
    ' recognize old record
    lastone = ActiveDocument.MailMerge.DataSource.ActiveRecord
    ' select next record
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
    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 | 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 >