Copy photo to Photo Editor (1 Viewer)

D

dennis g

Guest
I have searched here and the 'Net for help on this but can't find anything that deals exactly with my problem. I have a database with a linked image on it. I want to create a word document through mail merge that places the image on the word document along with some of the data from the table. Because it is not an imbedded object, I cannot use the acCopy copy command. I am working with an image control. I have the merge working great except for the image copy. I can paste it once I get it into the clipboard with no problem. I have been trying to send the image to MS Photo Editor and use it to load the image into the clipboard, but I having great troubles with the sendkey part. Access keeps sending the key strokes to itself, not to PhotoEditor. Here is the code I am having trouble with. If any one has a suggestion I am ready to try anything....

pic1 = Me.image
RetVal = Shell("c:\Program Files\Common Files\Microsoft Shared\photoed\photoed.exe " & pic1, 3)
AppActivate RetVal, 0
SendKeys "+(^C)", True
SendKeys "+{f4}", True
 
D

dennis g

Guest
Not Really Linked

Tim: No, the images are not really linked. Not as in OLE linked. The images are stored in a folder. There is a field with the path and file name in the table. The image control on the form has no name for the image. The OnCurrent event for the form has code that determines the file name (from the field) and sets the image control source from there. I have found this a better way to manage displaying images (for me). But, because the images are NOT linked, I can't easily copy them to the clipboard. If they were imbedded I could use the acCopy command to get them into the clipboard. I can get PhotoEditor to open with the correct image, I just can't get the SendKeys command to work. I've never used it before, so it could be a coding problem, that is why I posted my code. Tim, if you know of a better way of doing this, I'm all ears. Thanks for your reply.
 
D

dennis g

Guest
Never mind. I was using the incorrect sendkey combo. All is well. tim, thanks for pointing out the two articles. It's were I find my keystroke errors...
 

Users who are viewing this thread

Top Bottom