Thanks Ken for your prompt reply. I used Dennis's tlb to fork the code and
create CommandBar if it is version 11 or use GetCustomUI method in connect
module in the case of office 12.
I have my xml file for the ribbon. When I run it it shows up nicely, but how
can I hook the onAction to run the code that I already have for Button_click.
When specifying onAction callback it tries to find it in connect designer
module, and my buttons and associated events are declared my Inspector
wrapper class.
Thanks,
Goran
"Ken Slovak - [MVP - Outlook]" wrote:
What you have to do is check for versioning of the running Outlook and if
the major value is "12" you know it's Outlook 2007. Then you fork your code
to handle the ribbon in that case instead of creating the CommandBars UI you
would use for Outlook 2003 and earlier ("11" or less).
The easiest way to do that in VB6 code is to download Dennis Wallentin's
(XL-Dennis) XLIRibbonExtensibility tlb from his Web site and reference that
everywhere you want to use Ribbon extensibility. That lets you handle the
callbacks from the ribbon and to supply your custom XML for your Ribbon UI.
An alternative is to put the Office 2007 MSO file on your dev system and
reference that for the ribbon stuff, the CLSID's are compatible so your code
will still run under earlier versions of Office.
There's no conversion from VB6 to .NET code, except manually. You can start
a VSTO Outlook 2007 project and cut and paste your VB6 code in and then hand
translate it into VB.NET code. You have to take into account changes such as
changing all of your VB6 Long variables into VB.NET Int's and so on. That's
what I did to get my own templates and library code into VB.NET from VB6,
and I did the same translating the VB6 into C# for my C# templates.
The problem with VSTO is that if you develop for Outlook 2007 that's the
only version it will run on. If you develop for Outlook 2003 it will run on
Outlook 2007 but with no ribbon support. Since the shim is pre-compiled for
VSTO that means that Dennis's method doesn't work well with VSTO in
deployment, although the code works. For multi-version support in managed
code I use shared addins and a hack of the custom shims provided for the
Outlook team's sample addins that I modified to support Outlook 2003 with
shimmed ribbon support.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"goran" wrote in message
...
Hi All,
I have a working Outlook 2003 COM add-in written in VB 6.0 based on Ken's
ItemsCB template with Inspector wrapper class. It adds custom toolbar with
few buttons and dropdown on the Inspector window. It works in Outlook
2007,
but it is located under 'Add-ins' tab. What should I change so it will
show
up on the 'Message' tab instead, and use existing code in button_click
event.
Also what would be the easiest way to convert this to VSTO add-in for
Outlook 2007 so I don't have to change much.
Thanks,
Goran