Determine path to picture displayed in image control

A

Andrew

I know how to display a picture on the ActiveX image control, eg.
MyImage.Object.Picture = LoadPicture(strImagePath)

But does anyone know how to subsequently retrieve the image path from
the object? I've tried variations on
strImagePath = MyImage.Object.Picture
but without success.

FYI, I the images are in a worksheet and are being used to represent
various process operations. I'd prefer to keep track of what they are
through the image property rather than the name property since users
could copy/paste the objects resulting in a default xl generated name.

Thanks a lot,
Andrew
 
P

p45cal

Andrew;505210 said:
I know how to display a picture on the ActiveX image control, eg.
MyImage.Object.Picture = LoadPicture(strImagePath)

But does anyone know how to subsequently retrieve the image path from
the object? I've tried variations on
strImagePath = MyImage.Object.Picture
but without success.

FYI, I the images are in a worksheet and are being used to represent
various process operations. I'd prefer to keep track of what they are
through the image property rather than the name property since users
could copy/paste the objects resulting in a default xl generated name.

Thanks a lot,
Andrew

I'm not going to be authoritative on this one, but I think the clu
lies in the word 'LoadPicture', that is, it loads the picture into exce
and doesn't maintain any sort of link to the original file.
I can't find any .tag property where this information might be store
either.

However, if it's directly on a sheet it's a member of the shape
collection for that sheet and so the AlternativeText property could hol
that info.

MyImage.Object.ShapeRange.AlternativeText = "C:\Documents ...
or
MyImage.ShapeRange.AlternativeText = "C:\Documents...
depending on just what you've Set MyImage to.

You'll need to assign the alternative text at the same time a
LoadPicture. Copy/pasting this keeps its AlternativeText property.

Does it have to be in an activex image control
 
A

Andrew

Thanks a lot - .AlternativeText will work perfectly for me - in fact I
don't need to know the full path just the object type name so storing
just that is actually preferable.

I went with the ActiveX image control because it gives me the option
of trapping a right click event and maybe displaying some options that
way (although undecided whether I'll actually go that route). Did you
have a better alternative in mind?

Cheers,
Andrew
 

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