2

I need to perform a batch modification of metadata because my father wants to place a "title" in all .jpg images in a folder.

I told him to look into the photos and write down in a Excel spreadsheet the information to write down in order. One cell one file.

So I made the loop to read the spreadsheet but I don't know which file objects I need to use with the .jpg files and which methods can read or write a metadata tag.

MSDN gave no help for this.

A bit of code

Sub seleccionaYmuesrtra()
'in the first column there are the file names.
'in the second column there are the titles written manually

Dim image As ????
???? Set image = New Bitmap("c:\FakePhoto.jpg")

Cells(1, 1).Activate 'I start in the first cell.
Dim contenido, ruta, nombre As String 'some variables

ruta = "C:\imagesToUseinFolder"

While (Not IsEmpty(ActiveCell))  'this goes down in the first column until the first empty cell.
    nombre = ruta & ActiveCell.Value & ".jpg"
    contenido = ActiveCell.Offset(1, 0).Value
    '------------------------------------
    'HERE GOES THE ACTION I DON'T KNOW
    ...
    '------------------------------------
    ActiveCell.Offset(1, 0).Activate 'MOVE ONE DOWN

Wend


End Sub

I'm working in my laptop with windows7 but I think it should work in my parents desktop computer with XP. Thank you for your time, I hope that was not answered yet.

Community
  • 1
  • 1
Antonio E.
  • 359
  • 1
  • 9
  • 27
  • What Operating system are you using. if youa are using win 7 or 8 use attach url to help you. then http://lifehacker.com/5826412/to-quickly-rename-multiple-files-in-windows-just-hit-tab-or-f2 – Hiten004 Aug 20 '14 at 20:49
  • Where do you want to write this title? In a COM Marker? In an APPn marker? In the header of some JPEG file format? – user3344003 Aug 21 '14 at 07:09
  • @user3344003 I wan't it in the details tab in the properties pop-up when you right-click the image.I need the info easy to find my father, so if he's looking at the photos, if he want's to read what place it is he only has to hover the mouse over the photo's file icon. – Antonio E. Aug 21 '14 at 08:22
  • maybe it can't be done without any libraries. I've been reading, I think the metadata may be in ´xmp´ format. – Antonio E. Aug 26 '14 at 07:44

1 Answers1

0

You could try invoking a tool as a command-line command (if you need help invoking, see Execute a command in command prompt using excel VBA)

Exiftool is a good free, standalone executable that should do what you want:

http://www.sno.phy.queensu.ca/~phil/exiftool/

Community
  • 1
  • 1
pgr
  • 898
  • 11
  • 27