Connecting to a Device

Note

This scripting system has been replaced with Windows Image Acquisition (WIA) Automation Layer. See Windows Image Acquisition Automation Layer.

 

The first step in any application or script that uses the Windows Image Acquisition (WIA) scripting model is creating the Wia object. This object provides methods for to obtain a collection of DeviceInfo objects and connect these objects to devices. It also provides the ability to listen for WIA hardware events.

The following line of Microsoft Visual Basic Scripting Edition (VBScript) code creates the Wia object:

objWia = CreateObject("Wia.Script")

After creating the Wia object, use its Create method to connect to a WIA hardware device.

You can also use the Wia object's Devices property to obtain a collection of DeviceInfo objects. Enumerate this collection and use the Create method to connect to a device.