WIA Question

  • Thread starter Chris F via AccessMonster.com
  • Start date
C

Chris F via AccessMonster.com

Hello all-

I am trying to use WIA to take pictures off a memory card from a camera. I
have been through the WIA Automation tutorial and using some of the samples
created this code. However when it tries to take the actual pictures
selected as items, it returns 0 child items. Is there something I am missing?

My goal is to take the picture from the camera, save it to a particular path,
and save the particular path's string to the database.

Thank you in advance,
Chris

Dim DevDlg As New WIA.CommonDialog
Dim dev 'As Device
Dim itms 'As Items
Dim itm 'As Item
Dim dc 'As DeviceCommand
Dim i 'As Integer
Dim strLabelPhotoFile As String
Dim img As WIA.ImageFile
Dim f

i = 0
Set dev = DevDlg.ShowSelectDevice
Set itms = DevDlg.ShowSelectItems(dev, UnspecifiedIntent, MaximizeQuality,
False)

MsgBox "You selected " & itms.Count & " item(s)"

Set itm = itms(1)
For Each itm In itm.Items
Set img = itm.Transfer
strLabelPhotoFile = "C:\Downloads\Test" & i & ".jpg"
img.SaveFile strLabelPhotoFile
i = i + 1
Next
MsgBox "Number of pictures downloaded: " & i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top