Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed Object to Ole type field from Clipboard

Status
Not open for further replies.

ReluctantDataGuy

Programmer
May 15, 2003
131
US
I'm trying to embed an image from the clipboard (for example a screen snapshot) into a table. I have a table with an OLE field named "Graphic". I have a form that has a field to display the bound OLE object.

I can paste a picure into the field and it displays correctly. However, when I leave the record, the picture disappears. I have tried using the Object.Action method using acOLECreateEmbed, acOLEPaste, acOLEInsertObjDlg and acOLEPasteSpecialDlg.

Any ideas on how to make the object remain in the database?

BTW: I haven't tried this myself, but a users tells me that if he pastes the clipboard into another appication, and then copy / pastes from that application, the image stays. And he doesn't save the picture while in the other application. Not a very clean workaround.

Any help would be greatly appreciated.
 
Some addititional information. I just tried pasting into the same database on a PC with Office 2002 on it. I've got Office 2000)

An image pasted from the clipboard DOES stay in the database. This must be an enhancement in 2002. I'm still looking for a solution in 2000 though...
 
Hi ReluctantDataGuy,

Just out of interest, maybe take a look at Insert Ole Object Using a Common Dialog Control.zip at This is an OLE example I did for someone the other day. Tonight I've just added a button, caption "Insert an OLE Object by Pasting from the Clip Board". The code behind it is simply:

On Error GoTo Err_Paste
Me!BoundOLEControl.SetFocus
RunCommand acCmdPaste
Exit Sub
Err_Paste:
MsgBox Err.Number & " - " & Err.Description, , "Error"

Whatever is in the Clip Board is pasted into the OLE control and saved. Let me know if this works, if it does, there's possibly a problem with your own OLE control.

Bill
 
Thank you. It does work at home with Access 2000 and XP home. I'll try it at work Monday where we have Windows 2000.
 
Well Billpower, I wish I could say it worked. It must be the combination of Access 2000 and Windows 2000. We're in the process of converting to Windows 2000 + Office 2002 and it seems to work correctly on workstations that have already been converted. The users will just have to wait until they get converted.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top