Copy Image to paste into word.

J

Johnny Bright

Hi there!

I need to copy a linked image to the clipboard to be pasted into word. The
image on my form is based on a text box which contains the path to the image.
The image on my form is called ImageFrame and the path is in a text box
called Pic. When I click on the image, the copy command is not enabled on
the edit menu so of course the following won't work:

Private Sub ImageFrame_Click()
' Me.ImageFrame.PictureType = 0 this changes the image to an embedded
image

' DoCmd.RunCommand acCmdCopy
End Sub

If it's not possible to copy the image from my form, how easy/difficult is
it to programmatically open word and insert an image based on the path in my
form.

Thanks for all your help!
 
J

Jeanette Cunningham

Hi Johnny, I don't remember ever seeing any code that would do what you
require.
All code I know for copying from Access uses the standard windows clipboard
which copies and pastes text.

To get an image into a Word document programatically, I suggest you ask in
the Word newsgroup and try any newsgroups for images or just google for it.

Good luck with your search.
I suspect that what you want can't be done from within Access using just
VBA.

Jeanette Cunningham
 
S

Stephen Lebans

There are a couple of methods to choose from:

1) http://www.lebans.com/imagecontroltoclipboard.htm
mageControlToClipBoard.zip is a database containing a function that allows
you to copy the contents of a standard Image Control to the ClipBoard.
NEW - June 16/2000 Ver 1.0 Developed to allow Access to interact with other
programs by programmatically placing the contents of an Image control on the
ClipBoard in its native format.

OR

2) Use an Unbound OLE Frame control to load the linked Image into at
runtime. You can then either do:

a) Me.OLEUnBound19.SetFocus
DoCmd.RunCommand acCmdCopy

OR

b) ' Let's talk to to the OLE control directly
' and ask it to copy its contents to
' the ClipBoard.
Me.OLEUnBoundExport.Action = COPY_TO_CLIPBOARD

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top