View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Michael Singmin Michael Singmin is offline
external usenet poster
 
Posts: 60
Default Properties of a jpg

Greetings Michel,

Your code is amazing and I have more questions.
How do I access values in other properties of the jpg ?
Eg. I use the Subject field to hold the art genre.

Looking at your code, does this imply one can also add information
into a jpg using VBA ?

Would you care to explain what is happening in your code ?
Is there a jpg document on the Net that documents that structure
of a jpg and how one accesses these values ?

Thanks,

Michael Singmin

================================================== ===========
"Michel Pierron" wrote:

Hi Michael,
You can try:

Sub TestExample()
MsgBox JpgComment("c:\MyFile.jpg")
End Sub

Private Function JpgComment$(sFile$)
With CreateObject("Shell.Application") _
.NameSpace(Left$(sFile, lPosition(sFile, "\") - 1))
JpgComment = .GetDetailsOf(.ParseName(Dir$(sFile)), 14)
End With
End Function

Private Function lPosition%(Chain$, Char$)
Dim iPos%
Do
iPos = InStr(lPosition + 1, Chain, Char, 1)
If iPos Then lPosition = iPos Else Exit Do
Loop
End Function

Regards,
MP

"Michael Singmin" a écrit dans le message de news:
...
Hello Group,

Can one use VBA to extract certain properties of a jpg file that have
been added from Xp Explorer ?

I have collected tons of fine art images from web museums and I have
used the comment field in Explorer to record the year. While in
Explorer, I can easily sort the images in chronologiocal order.

I can display the art in Excel easily and I would like to extract any
information I place in the jpg.

Thanks,

Michael Singmin