?
Solved

WIA to find photos on camera/iPad and copy- issue with code

Posted on 2011-04-23
6
Medium Priority
?
414 Views
Last Modified: 2012-06-21
I have successfully used the code below to find photos on my iPad that are between a dat range.

However, when the photos are copied to a folder onmy hard drive, they end up with the date and time that they were copied, not when they were taken or 'created'.

I've viewed both the 'Modified' and 'Created' dates and both are the copied date and time.

If I access the iPad directly and then highlight/copy these same photos, the modified/created date/time are the correct

HELP!
'loop trough all (root) items in the camera device
    For Each itm In d.Items
    Dim f As Properties
    
    Set f = itm.Properties
    Dim str As String
        
    lCounter = lCounter + 1
        
        DoEvents
            
           
            strHold = ""
                    
            Name = d.Items(lCounter).Properties("Item Name").Value
            Ext = d.Items(lCounter).Properties("Filename extension").Value
            Set v = d.Items(lCounter).Properties("Item Time Stamp").Value
            PhotoDate = Format(v.Date, "mm/dd/yyyy")
            'Debug.Print "Photo Number " & Format(i, "##0") & "  Name: " & Name & "." & Ext & "  Date taken: " & PhotoDate

           If IsBetween(PhotoDate, dtDateFrom, dtDateTo) Then
            
            
                'download the file to a temp buffer
                Set imgpic = itm.Transfer
                
                
                'store the file name and extension and app.path in a string,
                'so you can use it to perform more operations on it
                str = App.Path & "\downloaded images\" & Name & "." & Ext

              
                imgpic.SaveFile str
                
           End If
           
        Next

Open in new window

0
Comment
Question by:scbdpm
  • 2
  • 2
5 Comments
 

Author Comment

by:scbdpm
ID: 35476758
bump
0
 
LVL 19

Expert Comment

by:Rimvis
ID: 35503021
0
 

Author Comment

by:scbdpm
ID: 35509283
not sure how this applies.....
0
 
LVL 19

Accepted Solution

by:
Rimvis earned 2000 total points
ID: 35510250
You need to change file time after you save your files to disk ("imgpic.SaveFile str")

1) Create variable with type SYSTEMTIME. Assign to value of v.Date
Dim dSysTime as SYSTEMTIME
dSysTime.wYear = Year(v.Date)
... and so on ...

2) Convert SYSTIME to FILETIME
Dim dFileTime as FILETIME
SystemTimeToFileTime(dSysTime, dFileTime)

3) Get a handle to your file
Dim hFile As Long
hFile = OpenFile(str, OFS, OF_READWRITE)

4) Change file time
SetFileTime(hFile, dFileTime, dFileTime, dFileTime)
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35892801
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question