View Single Post
  #1  
Old March 29th 10, 03:10 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba
escamoteur
external usenet poster
 
Posts: 147
Default Questions on the OutlookRibbonXCS example

Hi,

I studied the OutlookRibbonXCS example but don't understand everything completely.

Looking at

public bool ColorWidgetsGroup_GetVisible(Office.IRibbonControl control)
{
Debug.WriteLine("ColorWidgetsGroup_GetVisible");
OutlookInspector window = FindOutlookInspector(control.Context);
if (window != null)
{
Outlook.ContactItem contact = window.CurrentItem;
//Make the group visible only if an address exists
if (String.IsNullOrEmpty(contact.BusinessAddress) &
String.IsNullOrEmpty(contact.HomeAddress) &
String.IsNullOrEmpty(contact.OtherAddress))
{
return false;
}
else
{
return true;
}
}
return false;
}

Why the hassle with the FindOutlookInspector?

It's much easyer to do it like in this Example

public void RibbonCreateFromMailButton_Action(Office.IRibbonCo ntrol control)
{
Outlook.Inspector window = (Outlook.Inspector) control.Context;
if (window != null)
{
Outlook.MailItem item = (Outlook.MailItem) window.CurrentItem;
if (item != null)
{
theApp.Instance.BOManager.CreateBOFromMail(item);
}
}


Or do I miss something important here?
Best
Tom
Ads