Create barcode image in .VBS (VBScript) using Bytescout BarCode SDK - ByteScout

Create barcode image in .VBS (VBScript) using Bytescout BarCode SDK

  • Home
  • /
  • Articles
  • /
  • Create barcode image in .VBS (VBScript) using Bytescout BarCode SDK

Output barcodes (Code 39 and Aztec 2D barcodes):

Code 39 barcode generated with Bytescout BarCode SDK from Javascript (.JS) script Aztec 2d barcode image generated with Bytescout BarCode SDK in Javascript

This sample demonstrates the VBScript code to use Barcode SDK from vbscript to generate 1D and 2D barcodes. Bytescout BarCode SDK can be called from both Visual Basic .NET (as .NET assembly) and ActiveX compatible languages like Javascript, VBScript, Visual Basic 6 and other.

HelloWorld.vbs content:

Set bc = CreateObject(“Bytescout.BarCode.Barcode”)

‘ display information about Code39 symbology
msgbox “Encoding ‘012345’ using Code39 symbology” & vbCRLF & bc.GetValueRestrictions(0) ‘ 0 = Code39 symbology

‘ set symbology to Code39
bc.Symbology = 1 ‘ 1 = Code39 symbology type

‘ set barcode value to encode
bc.Value = “012345”

msgbox “Saving Code39 barcode to ‘Code39.png'”

bc.SaveImage “Code39.png”

msgbox “Encoding ‘012345’ using Aztec symbology

‘ set symbology to Aztec (2D)
bc.Symbology = 17 ‘ 17 = Aztec

‘ set barcode value to encode
bc.Value = “012345”

‘ display information about Aztec symbology
msgbox “Encoding ‘012345’ using Aztec symbology” & vbCRLF & bc.GetValueRestrictions(17) ‘ 17 = Code39 symbology

bc.SaveImage “Aztec.png”

Set bc = Nothing

Tutorials:

prev
next