|
|
||||||||
|
|
||||||||
| TALtech Home: Support: ActiveX Control KB: |
Basic Windows Script Host ExampleSystem Requirements
How to use this Example
Creating and Saving a bar code to disk'#################
Test1.vbs ############### 'declare a variable
to store the barcode object 'set message
and comment properties of Barcode. 'save barcode
using SaveBarCode method of ActiveX control: 'remove ActiveX
control and barcode info from memory: DiscussionTest1 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: '###########
test2.vbs ################## 'declare a variable
to store the barcode object 'Prompt user
for barcode information: the information they type into the input box
is saved into the variable names "Message$" and "Comment$"
(the "$" indicates that the information will be saved as a text
string, even if they type in numbers. 'set message
and comment properties of Barcode. 'save barcode
using SaveBarCode method of ActiveX control: 'remove ActiveX
control and barcode info from memory: 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. TroubleshootingWhen I double click on a .vbs file an "Open With..." box is displayedThis would indicate that the Windows Script Host is not installed. When I double click on a .vbs file the code appears in NotepadThis 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". Related LinksIntroduction to the Windows Script Host
|
|||||||||||||||||||||
|
|
|||||||||||||||||||||
|
|||||||||||||||||||||