Compile Addin for OL 2000 thru 2007

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an addin for Outlook that works in 2000 thru 2003. It also works in
2007 with a few changes. However, the 2007 version puts the buttons in the
Add-Ins tab. I have made changes to customize the Ribbon with my own tab &
everything works if I compile in 2007. However, since OL 2000 does not
contain the Ribbon definition, the addin will not compile there. I found a
partial solution by using a tlb that defines the IRibbonControl &
IRibbonExtensibility. By referencing this tlb, I can get the addin to compile
in 2000 and run in all versions.

The problem is I cannot include a definition for IRibbonUI in my code (it is
not defined in the tlb). Without this I cannot reload the Ribbon if something
changes. I tried late binding IRibbonUI, which works from a compile
standpoint, but according to other posts in Office Developer, late binding is
not supported.

Does anyone have another solution

The above mentioned tlb can be found at

http://www.xtremevbtalk.com/showthread.php?t=267904&highlight=outlook+2003+2007+ribbon
 
Are you talking about XL-Dennis's ribbon tlb? That will work when used with
an Office/Outlook 2000 set of references and the resulting addin will
support all those versions and have the ribbon in Outlook 2007.

I've used that tlb not only in VB6 code but also in managed code. It has a
reference to IRibbonUI that I use all the time. Just don't reference it as
Office.IRibbonUI, just declare it as IRibbonUI. Since the Office 2000 olb
doesn't have any IRibbonUI definition and the xlribbon.tbl does that's the
only reference you have to IRibbonUI and it resolves nicely using early
binding.
 
Don't deploy the tlb, it isn't necessary. You just have to have it on the
dev machine and added to the references list.

One tip using that, if you want to check the enabled state of a ribbon
control you can late bind to the Office.CommandBars.GetEnabledMso method or
other Mso related methods and use them. I use GetEnabledMso to check on the
status of various controls to see if I should enable mine. It's a little
slower late binding to those methods but it works nicely and preserves the
compatibility with the Office.olb. Just make sure you're running on OL12
before using any ribbon callbacks or Mso methods.
 
Back
Top