PDA

View Full Version : copy external image to clipboard



AJS
06-23-2008, 09:42 PM
Hi,

I have set up my database to display images stored elsewhere on my harddrive, using several fields to construct paths for the images. I'd like to write VBA that will copy the displayed image to the clipboard, but I have not been successful so far. The pertinent parts of my code are as follows. In my declared variables:

Dim MyDataObj As New DataObject
Dim strImagePath As String

where strImagePath is the full path for the image. Later on I try to get the image into the clipbard via:

Set MyDataObj = strImagePath
MyDataObj.PutInClipboard

With this approach I get a 424 error. Any other ideas?

Thanks, Aaron

OBP
06-24-2008, 04:41 AM
Can I ask why you want to copy the image to the Clipboard rather than displaying it?

AJS
06-24-2008, 04:05 PM
Can I ask why you want to copy the image to the Clipboard rather than displaying it?

To then paste it into another application (word).

stanl
06-25-2008, 03:08 AM
To then paste it into another application (word).

Since the images are stored as files, you might want to write VBA code for Word and use pictures.insert([filename]). .02 Stan