Visio 2003 add-on

S

Snoppolo

Hello,

I'm trying to create a Visio 2003 add-on in C# (i.e. an .exe) using
Visual Studio 2005. I started from samples coming with Visio SDK add-
on wizard, but they do not compile due to wrong namespaces. I see here
and there some post in this forum talking about the same problem but
no real solution about that. My questions are:
1) What is the correct namespace? All the samples start with
"Microsoft.Office.Interop.Visio", so what's the right one?
2) I read documentation about PIA and, a far as I know, my environment
seems ok, but still I don't find any usefull namespaces. I've tried
many and none seem to work properly
3) I've installed Visio 2003 SDK, Visual Studio 2005 and VSTO 2005. Do
I need some other tool or package? As I go deeper into the code, I
start thinking VSTO 2005 is useless for my purposes
4) Where on Microsoft site (or some other site) can I find a simple
and straight explanation on how to create an add-on for Visio 2003?
I've found a ton of explanation about add-ins, but this is not what I
want (maybe making an add-in is better? According to Microsoft docs an
add-on fits better in Office environment, the only drawback being
execution in a different process when you build the add-on as an .exe.
Am I orribly wrong??)

Sorry for the long post and thank you in advance for all your replies.


Snoppolo
 
J

JuneTheSecond

In my PC I have an example ploject about SolutionXML which I forgot where
comes from, but it seems works well.
In this example , the namespace is "Microsoft.Samples.Visio.CSharp".
I asume any name is OK, but "Microsoft.Office.Interop.Visio" may not be a
good example, because it is the special word to import Visio into the project.
 
M

Mark Nelson [MS]

Are you running the wizard from Visual Studio when you say Create Project
and then choose Visio Add-in or Add-on? That should result in a skeleton
project that compiles and runs.

1) The namespace is whatever you want in your project. You then should have
"Using Microsoft.Office.Interop.Visio;" in your code and
Microsoft.Office.Interop.Visio in your References.

2) Using the wizard to start your project ensures that the PIA and
Microsoft.Office.Interop.Visio are used.

3) You don't need VSTO 2005 explicitly for Visio. VSTO 2005 gives you the
ability to create "VSTO Add-ins" instead of "Shared Add-ins". For Visio and
VSTO 2005, there aren't many benefits and we recommend staying with Shared
Add-Ins. For VSTO 2008 and Visio 2007, there is better integration and we
recommend creating VSTO Add-ins.

4) I would recommend creating Visio Add-ins when working in managed code.
You definitely want to avoid being out-of-proc as performance will be much
slower. One resource you might check out is
http://www.visioconferencecontent.com/. Look for a session from Chris
Castillo on creating Visio Add-ins with .Net.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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