Printing bar codes in Word using Mail Merge - Advanced

Before you can use this section, see Printing bar codes in Word using Mail Merge.

If you use macro CiaxFillTablePro often, it can become boring to select all of the options each time, and if you select the wrong options errors could result.

The solution is simple - you can automate the process using a macro.

Creating an automation macro

Each time you run macro CiaxFillTablePro a report is displayed which includes lines similar to this;

To automate this job, create a macro containing this command;

Sub MyMacro()

CiaxFillTableProFunc "ShippingNo", "E128-0.BA"

End Sub

The above is the complete code for an automation macro (a macro that does the same as CiaxFillTablePro, but does not prompt you for any input).

- Highlight the line that begins CiaxFillTableProFunc and copy the text to the clipboard

CiaxFillTableProFunc "Shipping No", "E128-0.BA"

- Choose menu Tools | Macros and Visual Basic Editor

Now you are in the Visual Basic editor;

- Choose menu View | Project Explorer
- In the Project pane, under CiaxcomTemplate (Ciaxcom), open the Modules folder and double-click module CiaxFillPro
- Choose menu Tools | Macros...  

To modify a previously created macro, select its name and click Edit. Otherwise, to create a new macro, enter a unique macro name (e.g. MyDocBarcodes) and click Create.

- Paste from the clipboard, so the macro looks like this;

Sub MyDocBarcodes()
CiaxFillTableProFunc "Shipping No", "E128-0.BA"
End Sub

- Choose menu File | Save Ciaxcom and choose menu File | Close and Return to Microsoft Word

Now, each time before you print your Mail Merge document, you can run your new macro MyDocBarcodes, instead of CiaxFillTablePro

 

 


Copyright 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.