Inserting StdPicture as InlineShape

R

Ranco Marcus

In VBA code an image is received from an ActiveX object as an StdImage.

Dim Pic As StdPicture
Set Pic = Session.GetThePicture

I can easily show this image in a UserForm by setting the Picture property
of an Image control:

UserForm1.Image1.Picture = Pic

However, I would like to "paste" or insert this image into the
ActiveDocument preferably without saving it to file first or using the
clipboard. Is there any other way this can be accomplished?

Kind regards,

Ranco Marcus
 
J

Jonathan West

Ranco Marcus said:
In VBA code an image is received from an ActiveX object as an StdImage.

Dim Pic As StdPicture
Set Pic = Session.GetThePicture

I can easily show this image in a UserForm by setting the Picture property
of an Image control:

UserForm1.Image1.Picture = Pic

However, I would like to "paste" or insert this image into the
ActiveDocument preferably without saving it to file first or using the
clipboard. Is there any other way this can be accomplished?

Kind regards,

Ranco Marcus


Hi Ranco,

Put the full pathname of the picture into the Tag property of the Image
control when you select the image and show it in the UserForm. Then you can
pick up the path from the Tag property when the time comes to insert the
graphic into the document. Armed with the full pathname, you can use the
Shapes.Add method or InlineShapes.Add method, depending on whether you want
the picture inserted floating or inline.
 
R

Ranco Marcus

In VBA code an image is received from an ActiveX object as an StdImage.
Hi Ranco,

Put the full pathname of the picture into the Tag property of the Image
control when you select the image and show it in the UserForm. Then you can
pick up the path from the Tag property when the time comes to insert the
graphic into the document. Armed with the full pathname, you can use the
Shapes.Add method or InlineShapes.Add method, depending on whether you want
the picture inserted floating or inline.

Thanks for your reply Jonathan, but the image only exists in memory as an
StdImage (OLE). I would like to save it into the (Inline)Shapes collection
without saving it to disk first.

ciao,

Ranco
 
C

Cindy M -WordMVP-

Hi Ranco,
Thanks for your reply Jonathan, but the image only exists in memory as an
StdImage (OLE). I would like to save it into the (Inline)Shapes collection
without saving it to disk first.
Word can't do this. If you can stream it to the Clipboard, then you should
be able to PASTE it in. But that's your only other choice.

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

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