From: Daedalus on
Hi

I'd like to retrieve the timestamp of .jpg-files. The only thing I found was
that this info is stored in the exif-data of the files, but I can't find a
way to retrieve this from my vba-code.
Anyone ?

Tanx in advance !

D


From: HS Hartkamp on

Can't you use the general file-management functions to get the date created
of the file itself ? (JPG or otherwise)

Bas.


"Daedalus" <fdprojects(a)hotmail.com> wrote in message
news:4b37aadc$0$394$5f6aeac3(a)news.scarlet.nl...
> Hi
>
> I'd like to retrieve the timestamp of .jpg-files. The only thing I found
> was that this info is stored in the exif-data of the files, but I can't
> find a way to retrieve this from my vba-code.
> Anyone ?
>
> Tanx in advance !
>
> D
>


From: Phil on
On 03/01/2010 18:55:52, "HS Hartkamp" wrote:
>
> Can't you use the general file-management functions to get the date
> created of the file itself ? (JPG or otherwise)
>
> Bas.
>
>
> "Daedalus" <fdprojects(a)hotmail.com> wrote in message
> news:4b37aadc$0$394$5f6aeac3(a)news.scarlet.nl...
>> Hi
>>
>> I'd like to retrieve the timestamp of .jpg-files. The only thing I found
>> was that this info is stored in the exif-data of the files, but I can't
>> find a way to retrieve this from my vba-code.
>> Anyone ?
>>
>> Tanx in advance !
>>
>> D
>>
>
>

Adapt this a bit

Option Compare Database
Option Explicit

Function GetFileSize(strFileName As String, MinSize As Long) As Long
' ?getfilesize("C:\Documents and Settings\Phil\My
Documents\Access\MDB\WFYC\PDFS\DummyRenewal.pdf", 23000)

If strFileName = "" Then
Exit Function
End If

'Create an instance of the FileSystemObject
Dim fs As Object
Dim LngFileSize As Long
Dim objFile

On Error GoTo GetFileSize_Err
GetFile:
Set fs = CreateObject("Scripting.FileSystemObject")

'Get a file object
Set objFile = fs.GetFile(strFileName)

'Get the file size
LngFileSize = objFile.Size

' Here you can have
debug.Print objfile.datecreated
'or
debug.Print objfile.datelastAccessed
'or
debug.Print objfile.datelastModified

If LngFileSize < MinSize Then
'Debug.Print LngFileSize
GoTo GetFile
End If
GetFileSize = LngFileSize

GetFileSize_Exit:
Set objFile = Nothing
Set fs = Nothing
Exit Function

GetFileSize_Err:
Set objFile = Nothing
Set fs = Nothing
MsgBox Err.Description
Resume GetFileSize_Exit

End Function
From: Lars Brownies on
I think the OP wants to retrieve the timestamp of .jpg files and not the
date the file was created. For instance if you copy a file the 'date
created' is set to the current date while the info about when the picture
was actually taken remains intact. I think the OP needs to look for an
Active X control to get the right info.

Lars


"Phil" <phil(a)stantonfamily.co.uk> schreef in bericht
news:IKmdnVsIYbx-g9zWnZ2dnUVZ8oidnZ2d(a)brightview.co.uk...
> On 03/01/2010 18:55:52, "HS Hartkamp" wrote:
>>
>> Can't you use the general file-management functions to get the date
>> created of the file itself ? (JPG or otherwise)
>>
>> Bas.
>>
>>
>> "Daedalus" <fdprojects(a)hotmail.com> wrote in message
>> news:4b37aadc$0$394$5f6aeac3(a)news.scarlet.nl...
>>> Hi
>>>
>>> I'd like to retrieve the timestamp of .jpg-files. The only thing I found
>>> was that this info is stored in the exif-data of the files, but I can't
>>> find a way to retrieve this from my vba-code.
>>> Anyone ?
>>>
>>> Tanx in advance !
>>>
>>> D
>>>
>>
>>
>
> Adapt this a bit
>
> Option Compare Database
> Option Explicit
>
> Function GetFileSize(strFileName As String, MinSize As Long) As Long
> ' ?getfilesize("C:\Documents and Settings\Phil\My
> Documents\Access\MDB\WFYC\PDFS\DummyRenewal.pdf", 23000)
>
> If strFileName = "" Then
> Exit Function
> End If
>
> 'Create an instance of the FileSystemObject
> Dim fs As Object
> Dim LngFileSize As Long
> Dim objFile
>
> On Error GoTo GetFileSize_Err
> GetFile:
> Set fs = CreateObject("Scripting.FileSystemObject")
>
> 'Get a file object
> Set objFile = fs.GetFile(strFileName)
>
> 'Get the file size
> LngFileSize = objFile.Size
>
> ' Here you can have
> debug.Print objfile.datecreated
> 'or
> debug.Print objfile.datelastAccessed
> 'or
> debug.Print objfile.datelastModified
>
> If LngFileSize < MinSize Then
> 'Debug.Print LngFileSize
> GoTo GetFile
> End If
> GetFileSize = LngFileSize
>
> GetFileSize_Exit:
> Set objFile = Nothing
> Set fs = Nothing
> Exit Function
>
> GetFileSize_Err:
> Set objFile = Nothing
> Set fs = Nothing
> MsgBox Err.Description
> Resume GetFileSize_Exit
>
> End Function

From: Daedalus on

"Daedalus" <fdprojects(a)hotmail.com> schreef in bericht
news:4b37aadc$0$394$5f6aeac3(a)news.scarlet.nl...
> Hi
>
> I'd like to retrieve the timestamp of .jpg-files. The only thing I found
> was that this info is stored in the exif-data of the files, but I can't
> find a way to retrieve this from my vba-code.
> Anyone ?
>
> Tanx in advance !
>
> D

Sorry I didn't explain in detail. The exif-data contain much more info than
the file-timestamp, and I'm interested in these data (things like
resolution, which apparatus made the file, etc). The timestamp is only one
of those data, and is not the same as the Windows-timestamp.

D


 |  Next  |  Last
Pages: 1 2
Prev: DateCreated
Next: Special TIMESTAMP - 0912291327