Every ByteScout tool contains example VBScript source codes that you can find here or in the folder with installed ByteScout product. What is ByteScout BarCode Reader SDK? It is the barcode decoder with support for code 39, code 128, QR Code, Datamatrix, GS1, PDF417 and all other popular barcodes. Can read barcodes from images, pdf, tiff documents and live web camera. Supports noisy and damaged documents, can split and merge pdf and tiff documents based on barcodes. Can export barcode decoder results to XML, JSON, CSV and into custom data structures. It can help you to search barcodes in documents and write results to file in your VBScript application.
This rich sample source code in VBScript for ByteScout BarCode Reader SDK includes the number of functions and options you should do calling the API to search barcodes in documents and write results to file. Follow the instructions from the scratch to work and copy the VBScript code. Test VBScript sample code examples whether they respond your needs and requirements for the project.
Free trial version of ByteScout BarCode Reader SDK is available for download from our website. Get it to try other source code samples for VBScript.
' Create BarCodeReader object Set bc = CreateObject("Bytescout.BarCodeReader.Reader") ' Limit barcode search to PDF417 barcodes only bc.BarcodeTypesToFind.PDF417 = True ' Create File System object Set FSO = CreateObject("Scripting.FileSystemObject") ' Get folder object (current folder) Set objFolder = FSO.GetFolder(".") ' Get file list Set files = objFolder.Files ' Create output file Set TS = FSO.CreateTextFile("output.txt") ' Run barcode search for PDF and TIFF files For Each file in files ext = UCase(FSO.GetExtensionName(file)) If ext = "PDF" Or ext = "TIF" Then bc.ReadFromFile file.Name For i = 0 To bc.FoundCount - 1 ' Write found barcode information to output file TS.Write("File: """ & file.Name & """ Page " & CStr(bc.GetFoundBarcodePage(i)) & ": Barcode: " & bc.GetFoundBarcodeValue(i)) & vbCRLF Next End If Next TS.Close Set bc = Nothing Set TS = Nothing Set FSO = Nothing MsgBox "Done! See output.txt with found results"