CorelDraw & VBA
Summary & Introduction
Guide to CorelDraw VBA
Creating Variable Data
Variable Data From Access
Variable Data From Excel
Variable Data Without a Data File
CorelDraw BarCode Wizard
EAN13 BarCodes Without The Wizard
Code 39 BarCodes Without The Wizard
ITF-14 BarCodes Without The Wizard
Code 128 BarCodes Without The Wizard
QR BarCodes
Variable Pictures
Sorting for Guillotining
Repositioning Data
Pantone Colors
Saving VBA Code to a Previous Version of CorelDraw
Trim Marks
Miscellaneous VBA
CorelDraw BarCode Wizard

In this section I intend to show how automate the BarCode Wizard. The only automated method to use BarCode Wizard available, until Corel get their act together, is to use SendKeys. Here is a CorelDraw file that can create barcodes using BarCode Wizard using SendKeys. It is a CorelDraw 11 file but will also run in CorelDraw 12 through to X6.

Corel's BarCode Wizard has a problem when generating Code 39 barcodes with text. For some barcodes, such as 2C8M, the associated text the characters are double spaced apart. The barcode itself is still OK. I suggest not using Corel's BarcCode Wizard for Code 39 barcodes with text, instead de-select the option "Make this barcode human readable" when making the barcode.

The barcode generator is not pretty but it will work. It was trialled on several computers running Windows XP. A problem encountered is that a ZoneAlarm firewall must permit CorelDraw to open BarCode Wizard.

An annoyance with SendKey commands is that they usually turn-off Num-Lock. If you want to fix this, see the Miscellaneous VBA section where a method is available that will turn Num-Lock back on.

BarCodes created in BarCode Wizard in CorelDraw 12 & 11 appear as OLE objects that cannot be edited. If the BarCode is exported as an eps and then imported back into a CorelDraw 12 or 11 it is an eps object but still not editable. However if CorelDraw 12 or 11 is manually opened the eps file appears as multiple objects that can be edited. These new barcodes can be selected copied & pasted back into the original CorelDraw file. The barcode is editable as multiple objects. The numbers can be changed, the white background can be removed the barcode stretched & distorted.

In CorelDraw 12 or 11 the above is only partially automatable. The export procedure to an eps can be automated but there appears no way to open or import the eps file back into CorelDraw unless you use SendKeys.

If you want to modify the BarCode generated by BarCode Wizard then I recommend you use at least CorelDraw 13 & not 12 or 11.

The following code works well in CorelDraw X3 but not 12 or 11. Before running this procedure select a barcode in the document.

      Dim shBARCODE As Shape
      Dim lngBAROCODE As Long
'Export the BarCode to an eps file. The file over-writes any old files. Set shBARCODE = ThisDocument.Selection
'INSERT YOUR NAME BELOW IN <"YOUR NAME">!!!!! ThisDocument.Export "C:\Documents and Settings\<"YOUR NAME">\Desktop\BBB.eps", cdrEPS, cdrSelection
'Delete the CodeCode Wizard barcode ThisDocument.Selection.Delete
'Now insert the eps BarCode file into the original CorelDraw file. 'There is no VBA command so you must use CorelScript.
'INSERT YOUR NAME BELOW IN <"YOUR NAME">!!!!! lngBAROCODE = CorelScript.FileImport("C:\Documents and Settings\<"YOUR NAME">\Desktop\BBB.eps", cdrEPS, True)