Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Properties of a jpg
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Properties of a jpg
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using properties | Excel Discussion (Misc queries) | |||
Sheet properties Name and (Name) | Excel Discussion (Misc queries) | |||
Tab Properties | Excel Worksheet Functions | |||
Custom Properties | Excel Programming | |||
Arguments as properties | Excel Programming |