John,
You got me there... I don't have much experience with OLE objects, but from
what I've seen in the NGs, I think the general suggestion is to just store
references to the files on your disk, instead of embedding the objects
themselves. Maybe you should seek more advice on this.
For what it's worth, here's some sample code that will scan all the .jpg
files in a particular folder and put their names in an (existing) table
called tblFiles, just as long as the first field is type Text (and big
enough to hold long names! better make it 256):
Sub filenames_to_table()
Dim fldr, fls, fl
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set fs = CreateObject("Scripting.FileSystemObject")
Set fldr = fs.GetFolder("C:\FolderName\")
Set fls = fldr.Files
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblFiles")
On Error Resume Next
For Each fl In fls
If Right(fl.Name, 4) = ".jpg" Then
rst.AddNew
rst.Fields(0) = fl.Name
rst.Update
End If
Next fl
On Error GoTo 0
rst.Close
End Sub
HTH,
Nikos