Visio 2002 StdPicture into a shape

A

AlanK

This is a long shot, but...
Coding in VB6, I have a handle on an stdole IPictureDisp that represents a
location marker.
Is there anyway I can drop this on a Visio page at a specific x,y?
Thanks
 
L

LarryF

Save the image to a temporary file as a .bmp. I don't know the details
of IPictureDisp, but it should support a SavePicture() or something
similar. Then use page.Import() to load the picture into a Visio shape.
Then you can set the PinX and PinY to place it where you want.

Here's some VB6 that may help that deals with a picture box:

dim pctImage as PictureBox
....
dim visShape as Visio.Shape
dim sTempFile as string
if pctImage.Picture.Type = vbPicTypeBitmap then sTempFile = App.Path &
"\Temp.bmp"
SavePicture pctImage, sTempFile
set visShape = visPage.Import sTempFile
visShape.Cells("PinX") = x
visShape.Cells("PinY") = y
Kill sTempFile
....


HTH,

Larry
 
M

Michel LAPLANE

You can also use the clipboard and paste in the page but you have to know
how to manage it in you code.
 

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