Using WIA Collection Objects
A collection is an object that contains one or more objects. Collections provide an efficient way of grouping similar objects. Windows Image Acquisition (WIA) provides collections for the DeviceInfo and Item objects.
Use collections to enumerate the objects they contain. For example, the following VBScript example obtains a collection of DeviceInfo objects from the Devices method and then uses a For...Each loop to iterate through the collection:
<SCRIPT LANGUAGE="VBScript">
Dim objWia
Dim objDeviceInfoCollection
Dim objDeviceInfo
Set objWIA = CreateObject("Wia.Script")
Set objDeviceInfoCollection = objWia.Devices
For Each objDeviceInfo In objDeviceInfoCollection
' Do something with the DeviceInfo object.
Next
</SCRIPT>
Note
WIA collection objects are 0-based.
Tilbakemeldinger
https://aka.ms/ContentUserFeedback.
Kommer snart: Gjennom 2024 faser vi ut GitHub Issues som tilbakemeldingsmekanisme for innhold, og erstatter det med et nytt system for tilbakemeldinger. Hvis du vil ha mer informasjon, kan du se:Send inn og vis tilbakemelding for