Programmatically inserting an image

P

Pedro

Hello,

I have a C# app that automatically creates a visio document via the visio
interop. I create lots of shapes, but can't figure out how to insert a
picture. I've tried using InsertFromFile, but that only causes the name of
the file to appear on the screen.

Thanks,
Pedro
 
J

John Marshall, MVP

Sorry for the VBA code, but try something like

Application.ActiveWindow.Page.Import "C:\Documents and Settings\John\My
Documents\My Pictures\42713B2if_w.jpg"

A quick way of working out what to do is to use the Macro Recorder to record
the task and then take a look at the code in the VBE. The generated code
relating to UndoScope can be discarded.

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 

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