Selected Shape in Visio ActiveX Drawing control - C#

P

Pradeep

I am working on Visio ActiveX Drawing control.
I request some one to help me out with the code in C# to get the shape which
is slected in the visio diagram.
I have to access the properties of the shape that is selected in the
diagram. Please help me out...Language is C#.
 
P

Pradeep

Hi Chris,

Thanks for the reply.
I am unable to import or Use the reference
"using Visio = Microsoft.Office.Interop.Visio"
even though I have added a reference of "Microsoft Visio 11.0 Type Library"
to my project.
Please let me know the pre-requisites for this.

Thanks,
Pradeep

Chris Roth said:
Hi Pradeep,

Try something like this:

using Visio = Microsoft.Office.Interop.Visio;

....

Visio.Selection sel = visctrl.Window.Selection;

Visio.Shape visShpSelected;
if(sel.Count > 0)
{
visShpSelected = sel.Selection[1]
}

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/

Pradeep said:
I am working on Visio ActiveX Drawing control.
I request some one to help me out with the code in C# to get the shape
which
is slected in the visio diagram.
I have to access the properties of the shape that is selected in the
diagram. Please help me out...Language is C#.
 

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