Printing bar codes in Lotus Notes

There are unlimited ways you can create, store and print bar codes.

You can create bar codes anywhere that you can use Lotus Script functions.

To create bar codes use Lotus Script call any of the Bar code functions. Only one line of code is needed;

MyBarcode = CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

Because the result of all bar code functions is a text string, you can store the bar code in; string variables, form fields, database text fields, simple text files, text messages, HTML files, documents, or anywhere you can store a text string.

After the bar code is created as a text string, the bar code (i.e. the text string) is printed as a bar code using a bar code font.

See: Bar code functions to discover the function to use to create each type of bar code.

See: Bar code font name and font size to use to discover the font and font size to select - to print the result of each bar code function.

Creating bar codes in forms - using Querysave

In section Edit a form to insert field to display bar code we saw how to create bar codes using data from a database field, and how to store the bar code in another field.

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Source.FieldSetText "Barcode", CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

...

End Sub

To display and print bar codes that have been calculated and stored in a field, when the field is displayed or printed you must set the font property to a special bar code font.

Select the object that will be displayed or printed the field. View the properties of the object and set the font properties.

Click Font tab. Use these settings;

Font CIA Code 128 Normal
Size 14
Style Plain

Select menu View | Programmer's Pane. Click Objects tab, then select object [-] Document (Form) and select (Options). Enter Lotus Script code;

Use "ciaxcom"

Select event Querysave and this Lotus Script code will appear;

Sub Querysave(Source As Notesuidocument, Continue As Variant)

...

End Sub

Insert this line of code;

Source.FieldSetText "Barcode", CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

as the first line, like this example.

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Source.FieldSetText "Barcode", CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

...

End Sub

 


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