Interop or VSTO or ?

G

Glenn Welker

Long time developer of addins but have been out of development for
three years. Last experience was with VB6 and was fairly painless.
Forgive me for asking multiple questions. It seems that they are all
essentially the same topic.

I have no interest in using VB6 at this point but I need advice on how
to move forward into .NET. I am confused as to my options.

Targets currently are Outlook 2003 and 2007. I currently don't need
the new functionality in 2007. This suggests that I can use the VSTO
but.

1. I currently have Office 2007 and VS 2008 installed. I also
installed the 2003PIA but it keeps complaining that it the 2003 pias
aren't installed. Is it possible to develop an addin for 2003 on a
machine with Office 2007 installed?

2. When targeting multiple versions, it seems as though developers are
creating separate dlls. Can these be tied together in a single install
or are other developers creating single dlls to target multiple
versions?

3. What is most common, VSTO or using the IDTExtensibility2 interface?

Once again, any help is greatly appreciated.
 
K

Ken Slovak - [MVP - Outlook]

You can't just install a PIA, the last one installed wins. If you want to
develop for Outlook 2003 you need that installed.

A VSTO addin for 2003 will run in 2007 but won't handle the ribbon, custom
task panes, etc. A VSTO addin for Outlook 2007 won't run at all on 2003.

When I need to target multiple versions of Outlook I compile on the oldest
one and use a shared addin rather than a VSTO addin. To shim it so it has
its own AppDomain I use the COM Shim Wizard which comes with VS2008. That
way I can fork my code based on version and handle CommandBars for UI for
2003 and the ribbon for UI in 2007 for Inspectors. For Explorers both
versions use CommandBars, but be aware that in Outlook 2010 Explorers also
use the ribbon and the old CommandBars interface pushes your UI into the
hard to discover Add-Ins tab.

I have test addins now that are running on Outlook 2003, 2007 and 2010 that
correctly handle the relevant UI based on the runtime version of Outlook,
all in one addin DLL.

Shared addins use Extensibility. So do VSTO addins, but VSTO handles those
interface events and just provides you with Startup() and Shutdown()
handlers. VSTO also shims your code for you, something the shim wizard also
does.
 
G

Glenn Welker

You can't just install a PIA, the last one installed wins. If you want to
develop for Outlook 2003 you need that installed.

A VSTO addin for 2003 will run in 2007 but won't handle the ribbon, custom
task panes, etc. A VSTO addin for Outlook 2007 won't run at all on 2003.

When I need to target multiple versions of Outlook I compile on the oldest
one and use a shared addin rather than a VSTO addin. To shim it so it has
its own AppDomain I use the COM Shim Wizard which comes with VS2008. That
way I can fork my code based on version and handle CommandBars for UI for
2003 and the ribbon for UI in 2007 for Inspectors. For Explorers both
versions use CommandBars, but be aware that in Outlook 2010 Explorers also
use the ribbon and the old CommandBars interface pushes your UI into the
hard to discover Add-Ins tab.

I have test addins now that are running on Outlook 2003, 2007 and 2010 that
correctly handle the relevant UI based on the runtime version of Outlook,
all in one addin DLL.

Shared addins use Extensibility. So do VSTO addins, but VSTO handles those
interface events and just provides you with Startup() and Shutdown()
handlers. VSTO also shims your code for you, something the shim wizard also
does.

As always, thanks for the detailed response. Looks like I have my work
cut out for me. : )
 

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