C# Office add-ins for 2003/2007 and ribbon

S

shari.foreht

We have an office add-in for Word and Outlook, coded originally for
Office 2003. It works ok with Office 2007, where it puts the add-in
under the Add-Ins ribbon item, and then has a Menu, and then our Add-
in. It isn't the prettiest looking place for it, so we are wondering
about modifying it to make use of a custom ribbon.

A couple of concerns with that:
1) We would have to maintain two codestreams. I'm not sure it's
worth it to create a separate ribbon item for it - what would it
really buy us?
2) How would a custom ribbon item be handled by all the add-ins out
there that make the ribbon look like old 2003?


Thoughts/opinions welcome!


thanks
 
J

Jayme.Pechan

I have found that in general, the same add-in can work on both 2003/2007 of
Office. The ribbon is a separate interface that just doesn't get used in
2003. Information on how to use it can be found here:

http://msdn2.microsoft.com/en-us/library/aa338202.aspx

The only thing I haven't been able to resolve is determining when Office
2007 is in use so I don't display the custom toolbar. When 2007 is being
used, my ribbon is being displayed and essentially replaces the toolbar.
They can both be there but it seems kind of silly to have a fancy ribbon and
then have an add-in tab contain the same buttons in a less elegant way.

Does anyone know of a decent way to deal with this situation so the same
add-in can be used with 2003/2007?

Thanks.
 
J

Jayme.Pechan

I answered my own question. In the OnNewInspector function, I can just
check the version of the inspector.Application.Version to see if it is 12 or
higher. If it is, I simply exit instead of adding my custom toolbar in
code. Then my ribbon stuff gets called.

So the answer is that the same control can be used for both versions so you
don't need to maintain 2 code bases.
 
J

Jayme.Pechan

One thing to note here is that if the Add-in is created using .NET, it is
much more difficult to combine the code bases because of the way the
references are dealt with. You should be ok under C++ but I'd recommend 2
code bases if you use .NET to developer your addin.
 

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