title: How to get Microsoft Access to get the file dimensions saved to a table?
body: <p>How to get Microsoft Access to get the file dimensions saved to a table?
  This is the code I am using. Any help you can offer on how I can pull the image file dimensions and add them to my table.</p>
  <pre><code>Sub ListFiles()
        
      Dim Counter As Integer
      
      Set myObject = New Scripting.FileSystemObject
      Set MySource = myObject.GetFolder(&quot;X:\I m A g E - F o L d E r\Website\Brochure Images &amp; PDF\&quot;)
      
      On Error Resume Next
        
      DoCmd.RunSQL &quot;DELETE *FROM tblPDFs&quot;
   
      Dim db As Database
      Dim rst As Recordset
      Dim mysql As String
      
      Set db = CurrentDb()
      mysql = &quot;tblPDFs&quot;
      Set rst = db.OpenRecordset(mysql, dbOpenDynaset)
        
      For Each MyFile In MySource.Files
          rst.AddNew
          rst![FilePath] = MyFile.Path
          rst![FileName] = MyFile.Name
          rst![FileDim] = MyFile.Dimensions
          rst![FileType] = MyFile.Type
          rst.Update
            
                    Counter = Counter + 1
      Next
            
  
      ' Clean up
      rst.Close
      db.Close
      Set rst = Nothing
      Set db = Nothing
       
      Set myObject = Nothing
      Set MySource = Nothing
       
      MsgBox &quot;Listed &quot; &amp; Counter &amp; &quot; Files.&quot;
  
        
  End Sub
  </code></pre>