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.

Who is Participating?
P3adminConnect With a Mentor Author 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

Try the record macro facility -

my try in visio 2003 came up with:

    Application.ActiveWindow.Page.Drop Application.Documents.Item("ORGCH_M.VSS").Masters.ItemU("Executive"), 5.19685, 5.669291
P3adminAuthor Commented:
If only it were that simple... Recording a macro for this doesn't catch the insert picture part.
All Courses

From novice to tech pro — start learning today.