Detach an OLE 'Microsoft Photo Editor' Photo

I would like to know how to detach a 'Microsoft Photo Editor' Photo that was embedded into an OLE field in an Access 97 Table.  I would then like to save this file, giving it the name of one of the other fields in this same table.  Can this be done?  And how can I then display this photo with just a text field that contains the path to this file.  
TerryEllisAsked:
Who is Participating?
 
zacharConnect With a Mentor Commented:
1. To save the file you can use the following code: (not so elegant, but works)

     Me.Pic.Action = acOLEActivate
     DoEvents
     SendKeys "+{TAB}%FA+{END}{DEL}C:\temp\temp.gif%s"
     DoEvents
     SendKeys "+{TAB}%{F4}"

in this example "Pic" is OLE field, and the file name "C:\temp\temp.gif" you should exchange by your taken from other field. Before you do this, check if is file with this name exists.

2. to show this picture create on the form Image control, and use the code like this:

Me.Image1.Picture = "C:\TEMP\Image1.jpg"

(File name exchange with taken from the text field in your table)

Good luck.


0
 
TerryEllisAuthor Commented:
Thank You.
0
All Courses

From novice to tech pro — start learning today.