Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exif

35 views
Skip to first unread message

Daedalus

unread,
Dec 27, 2009, 1:49:53 PM12/27/09
to
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


HS Hartkamp

unread,
Jan 3, 2010, 1:55:51 PM1/3/10
to

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

Bas.


"Daedalus" <fdpro...@hotmail.com> wrote in message
news:4b37aadc$0$394$5f6a...@news.scarlet.nl...

Phil

unread,
Jan 3, 2010, 5:49:08 PM1/3/10
to

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

Lars Brownies

unread,
Jan 4, 2010, 7:01:40 AM1/4/10
to
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" <ph...@stantonfamily.co.uk> schreef in bericht
news:IKmdnVsIYbx-g9zW...@brightview.co.uk...

Daedalus

unread,
Jan 6, 2010, 10:55:42 AM1/6/10
to

"Daedalus" <fdpro...@hotmail.com> schreef in bericht
news:4b37aadc$0$394$5f6a...@news.scarlet.nl...

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


Allen Browne

unread,
Jan 7, 2010, 4:40:42 AM1/7/10
to
Haven't tried it in VBA, but the usual VB approach is explained here:

http://www.vbaccelerator.com/home/VB/Code/vbMedia/Using_GDI_Plus/Reading_EXIF_and_Other_Image_Properties/article.asp

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Daedalus" <fdpro...@hotmail.com> wrote in message

news:4b44b108$0$398$5f6a...@news.scarlet.nl...

0 new messages