title: Set extended attributes of image files using VBA
body: <p>I am trying to build an Excel-VBA based tool where I need to capture and edit the file attributes of image (.jpg) files stored on my hard-disk, including some extended attributes  (specifically the comment attribute). </p>
  
  <p>I was able to get the code to loop through the files and capture the extended attributes like Author, Keywords, Comments etc and other properties which are visible when right clicking on the file.</p>
  
  <p>I am now trying to write/edit these attributes but I am unable to find any way of doing so. It would be great if you could help with the exact code snippets for VBA.</p>
  
  <p>The Code that I have used to read these attributes is below (From Alex K) </p>
  
  <p><a href="https://stackoverflow.com/questions/5651890">Using VBA to get extended file attributes</a></p>
  
  <pre><code>Dim sFile As Variant
  Dim oShell: Set oShell = CreateObject("Shell.Application")
  Dim oDir:   Set oDir = oShell.Namespace("c:\foo")
  
  For Each sFile In oDir.Items
   Debug.Print oDir.GetDetailsOf(sFile, 24) '24 - index corresponding to comments  
  Next
  </code></pre>