Inserting an image from a userform into a table in WORD

K

Kernal

Here is what I want to do:

I have a userform that opens by use of a command button
which is in a table in a WORD document.

The userform contains multiple pictures and corresponding
option buttons, and an OK and Cancel command button.

I want to be able to select one picture and click OK and
have the picture pasted into the bookmarked cell on the
WORD table.

My pictures are on image boxes. Am I better off putting
pictures on the option buttons?

I will have many cells with different pictures on the
document.
 
C

Cindy Meister -WordMVP-

Hi Kernal,
I want to be able to select one picture and click OK and
have the picture pasted into the bookmarked cell on the
WORD table.

My pictures are on image boxes. Am I better off putting
pictures on the option buttons?
When you use an Image control in a UserForm, the picture is
linked in from a file, is it not?

So, what you'd do is use Word's InlineShapes.AddPicture
method to pick up the picture from the original file and
bring it into the document. Set the RANGE argument to the
bookmark range where you want it to be.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
C

Cindy Meister -WordMVP-

Hi Kernal,
The pictures will be linked from a file. I have been
trying many codes, and cannot get this to work.
Place the path to the picture in the TAG property of the
image or the option button control:

ActiveDocument.InlineShapes.AddPicture _
FileName:=Image1.Tag, LinkToFile:=True, _
Range:=Selection.Range


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
K

Kernal

I can get the pictures in a different file to link fine.
What I need is the code for my OK commandbutton on my
userform to paste a picture (selected with one of six
optionbuttons) onto a table in a WORD document. I cannot
get my "OK" commandbutton code correct.

Summary:
Open userform
Select optionbutton to desired picture
Picture pastes into table in WORD doc

code = ??? (i.e. If optoptionbutton2.value=true then...???)


THANK YOU!!!
 
C

Cindy Meister -WordMVP-

Hi Kernal,
I can get the pictures in a different file to link fine.
What I need is the code for my OK commandbutton on my
userform to paste a picture (selected with one of six
optionbuttons) onto a table in a WORD document. I cannot
get my "OK" commandbutton code correct.
As far as I know, there is no way to *copy and paste* a
picture from a UserForm. I could be wrong. Perhaps it could
be done using the Windows API. But then you might have more
luck asking in a VB group...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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