System requirements
Using this example
- Install Microsoft Windows Script Host if necessary (WSH is an intrinsic part of Windows 98 and 2000).
- Install TAL Barcode ActiveX Plus on your Web Server.
- Download the files discussed in the example below. This is a self extracting zip file containing the VBScript code.
- Double click on the downloaded file and extract the files. (By default they are extracted to your temp folder (“C:\Windows\temp” on Windows 95/98 machines and “C:\temp” on Windows NT/2000 machines)
- Locate the file test.vbs through Windows Explorer and double click on it to run the code.
- Open Microsoft Word, go to the INSERT menu and choose PICTURE, then FROM FILE, type or navigate to “C:\barcode.wmf” and click OK. You should be rewarded with a barcode
Creating and saving a barcode to disk
Discussion
Test1 demonstrates how to use the Windows Script Host with our ActiveX control, but unless you always intend to create the same barcode this is not a very useful real world example. To make it a little more interactive we can add input boxes that prompt the user for information:
This is all well and good for creating a handful of similar barcodes, but if you try to prompt the user in this fashion for all the information (message, comment, symbology, rotation, colors, fonts, etc) it will be very time consuming and frustrating for the user. One way to fix this is to create a form in Visual basic and call it as a com object from the VBScript file. More advanced examples to demonstrate this and other techniques will be made available soon.
Troubleshooting
When I double click on a .vbs file an “Open With…” box is displayed.
This would indicate that the Windows Script Host is not installed.
When I double click on a .vbs file the code appears in Notepad.
This would indicate that the .VBS extention has been associated with notepad, either because the Windows Script Host is not installed, or because (perhaps as a security precaution) the default open method for .VBS files has been modified to “edit” instead of “run”.Last modified on November 3, 2026