VBScript
Barcodes in Visual Basic Script
How to use barcodes in VBScript (Windows Script Host)
1
You can use ActiveBarcode with VisualBasic-Script (VBS, Windows Script Host) to create barcodes
in scripts automatically. Here we show you how simple is it to use ActiveBarcode in VBS.
First make the ActiveBarcode control available in your script:
Dim barcodeNow you can use the variable 'barcode' to access the control. Use the Properties of the control to create the barcode you want:
Set barcode = WScript.CreateObject("ACTIVEBARCODE.BarcodeCtrl.1")
barcode.Typename = "Code128"Then use the 'SaveAsBySize' method to save the barcode in a specific size to an image file:
barcode.Text = "123456789012"
barcode.SaveAsBySize "beispielbarcode.png",400,200Click here to download the above example as wsf file.
2
A very detailed example for a VisualBasicScript application is the console application BarcodeImage.
- Go to BarcodeImage on GitHub.
- View the source code for 'BarcodeImage.wsf'.
- Download 'BarcodeImage.wsf'.