Question : Saving Access OLE Object Bitmaps to BMP files

Hello:
I have an Access table containing an OLE Object field called "Image", and each record contains a small bitmap image.  I'm having trouble finding the VB command to export these to a series of BMP files.  

The table also contains a "name" field identifying who the image is.  My intention is to use the Name field to dictate the name of the file to which I will save each image.  If, for example, the names were Arnie, Betty, and Cammie, and I wanted to save the images into the C:\Images\ directory, I would expect to the process to finish with these three files:

C:\Images\Arnie.bmp; C:\Images\Betty.bmp; C:\Images\Cammie.bmp

I've include a code block that shows my progress thus far.  Thanks, in advance, for your assistance with this.
~Peter Ferber
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Sub MigrateImages()
    Dim MyDB As Database
    Dim MyRcd As DAO.Recordset
    
    Dim strsql As String
    
    Set MyDB = CurrentDb
    strsql = _
        "Select" & vbcrlf & _
        "    Image" & vbcrlf & _
        ",   Name" & vbcrlf & _
        "FROM" & vbcrlf & _
        "    tblImages"
    Set MyRcd = MyDB.OpenRecordset(strsql, dbOpenDynaset)
    If (Not (MyRcd.BOF And MyRcd.EOF)) Then
        MyRcd.MoveFirst
        While (Not MyRcd.EOF)
            <Code to export images goes here>
        Wend
    End If
End Sub

Answer : Saving Access OLE Object Bitmaps to BMP files

Hi Peter

I think this might be what you are looking for...

http://www.lebans.com/oletodisk.htm

--
Graham

Random Solutions  
 
programming4us programming4us