A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Questions on the OutlookRibbonXCS example



 
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old March 29th 10, 08:44 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba
Brian Tillman [MVP-Outlook]
external usenet poster
 
Posts: 1,043
Default Questions on the OutlookRibbonXCS example

"escamoteur" wrote in message
...

Hi,

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

Looking at

public bool ColorWidgetsGroup_GetVisible(Office.IRibbonControl
control)


Please post programming questions in the programming groups.
microsoft.public.outlook.program_vba seems appropriate to me.
--
Brian Tillman [MVP-Outlook]

  #3  
Old March 29th 10, 11:30 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Questions on the OutlookRibbonXCS example

I think you misunderstood what Randy was doing. He was using a list to
maintain an Inspector wrapper collection and using that method to try to
locate that Inspector in the wrapper collection list.

Window was what an Inspector was called in that sample.

You can be very sure that Randy knows what he's doing

--
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


"escamoteur" wrote in message
...
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


  #4  
Old March 30th 10, 02:07 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

I think I understood what he wants to achieve with the tracking of inspectors and explorers, but to access the Item of an Inspector
that in the Handler of a Ribbon I think it's not neccessary to do it they hey did, the way I proposed is much more straight forward.
So I wondered what his reason may have been to do it that way.

Best
Tom

"Ken Slovak - [MVP - Outlook]" schrieb im Newsbeitrag ...
I think you misunderstood what Randy was doing. He was using a list to maintain an Inspector wrapper collection and using that
method to try to locate that Inspector in the wrapper collection list.

Window was what an Inspector was called in that sample.

You can be very sure that Randy knows what he's doing

--
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


"escamoteur" wrote in message ...
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


  #5  
Old March 30th 10, 02:32 PM posted to microsoft.public.developer.outlook.addins,microsoft.public.outlook.interop,microsoft.public.outlook.program_addins,microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Questions on the OutlookRibbonXCS example

Most of us use some sort of wrapper collection like Randy's, whether it's a
list/dictionary/sorted list/collection or whatever. It's very necessary and
equally so for the ribbon where you might for example want to maintain
different states for various controls such as drop-downs or toggle buttons
per Inspector or Explorer. I don't see any wasted code there.

--
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


"escamoteur" wrote in message
...
I think I understood what he wants to achieve with the tracking of
inspectors and explorers, but to access the Item of an Inspector that in
the Handler of a Ribbon I think it's not neccessary to do it they hey did,
the way I proposed is much more straight forward.
So I wondered what his reason may have been to do it that way.

Best
Tom


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions krzatchok Outlook - Installation 1 March 24th 10 02:04 AM
Two questions L and B Outlook - General Queries 0 March 4th 08 01:25 AM
2 questions Dan Outlook - Using Contacts 1 April 24th 07 02:44 PM
QUESTIONS graichi hassen Outlook Express 0 March 10th 07 08:24 PM
.pst questions Donna in Idaho Outlook - General Queries 3 April 16th 06 06:48 PM


All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.