Where is the menu or VBA for "Insert Picture" into a shape in Visio?

Using Visio, there are two ways (at least) to insert a picture *into* a shape. One is to use the Insert > Picture menu. The other is to right-click on a shape (in this case, an org chart shape) and select "Insert Picture...". This way is much better because it puts the picture inside the shape and doesn't need to be resized or anything. They don't work the same way.

I need to know how to access this special context menu/option in VBA. The standard function (eg: objCurrentShape.Import "C:\pics\picture.jpg") is not sufficient as the pictures don't move or resize with their shape.

Has anyone got any potential solutions to this? Even code to call a right-click event on a shape would help, or how to resize an image and make it stay next to its shape the way that option 2 does.

The problem is the same in Visio 2007 and 2003; I have both installed.

Thanks!
Insert-Picture-Menu.jpg
P3adminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

werafaCommented:
Try the record macro facility -

my try in visio 2003 came up with:

Application.Windows.ItemEx("Drawing3").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("ORGCH_M.VSS").Masters.ItemU("Executive"), 5.19685, 5.669291
0
P3adminAuthor Commented:
If only it were that simple... Recording a macro for this doesn't catch the insert picture part.
0
P3adminAuthor Commented:
Found it. Here is the code to run the Insert Picture dialog box for inserting them into shapes.
Dim objAddOn As Visio.Addon
    Set objAddOn = Visio.Addons("OrgC11")
    
    'Invoke the insert picture dialog
    objAddOn.Run "/cmd=InsertPicture"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.