Questions on the OutlookRibbonXCS example

Status
Not open for further replies.
E

escamoteur

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.IRibbonControl 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
 
B

Brian Tillman

"escamoteur" <mail@burkharts.net> wrote in message

news:B4ED3D8B-1F75-4980-BCE7-29105A67B271@microsoft.com...


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

--
 
K

Ken Slovak - [MVP - Outlook]

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

"escamoteur" <mail@burkharts.net> wrote in message

news:B4ED3D8B-1F75-4980-BCE7-29105A67B271@microsoft.com...
> 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.IRibbonControl
> 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
 
E

escamoteur

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
<kenslovak@mvps.org> schrieb im Newsbeitrag news:uryRGiA0KHA.4384@TK2MSFTNGP06.phx.gbl...
> 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 :)

> >

>

> "escamoteur" <mail@burkharts.net> wrote in message news:B4ED3D8B-1F75-4980-BCE7-29105A67B271@microsoft.com...
> > 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.IRibbonControl 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

>
 
K

Ken Slovak - [MVP - Outlook]

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.

"escamoteur" <mail@burkharts.net> wrote in message

news:et$fynA0KHA.244@TK2MSFTNGP06.phx.gbl...
> 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
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
E Questions on the OutlookRibbonXCS example Outlook VBA and Custom Forms 4
P Questions On Crashing, Sluggish, and Configurations Using Outlook 1
J Diane's Delay Delivery at Specific Times Questions Outlook VBA and Custom Forms 5
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
Rupert Dragwater Several questions regarding Outlook 2013 Using Outlook 9
D Outlook for Android Questions Using Outlook 8
O flagging replies - several questions Using Outlook 2
P Moving PST file questions Using Outlook 3
Y PST file questions Using Outlook 1
D Questions related to usage of webpage in outlook Using Outlook 1
G Questions on creating Outlook forms Using Outlook 0
O x86 vs. x64 Sql Server 08 Dbase Questions BCM (Business Contact Manager) 2
Jennifer Murphy Questions about ANSI-Unicode PST conversion article Using Outlook 2
J Multiple Outlook questions Using Outlook 2
P Field option selection resulting into multiple questions BCM (Business Contact Manager) 0
S Questions about Calendar Notifications Using Outlook 1
H Couple of 2007 Calendar questions Using Outlook 1
K CPA - Office 2010 - 64 bit Questions Calendar Printing Assistant 1
S Couple of questions related to calender Using Outlook 1
S Seperating email accounts, Syncronizing, and a few newbie questions Using Outlook 5
T Outlook 2010 Mutliple Exchange Accounts SET UP QUESTIONS Using Outlook 4
S Exchange Server Beginner Questions Exchange Server Administration 2
M MS Outlook 2010, 2 questions, 1 about pasting and 1 about sending Using Outlook 1
U 2 easy questions, Outlook 10 and an AOL IMAP type account Using Outlook 4
D 3 Easy Questions for Gurus on Word 2007 and Outlook 2010 Using Outlook 11
J Certificate questions and understanding Exchange Server Administration 6
U 3 easy questions, Outlook 10, mail and contacts Using Outlook 6
R calendar default permissions - several related questions Using Outlook 1
D CAS Array Questions Exchange Server Administration 3
I Outlook 2010 questions, Mass import into contact group, cull duplicate addressbook entries, alphabet Using Outlook 1
D Questions and Answers in Live Meeting 2007 Using Outlook 1
M Questions about product keys for Office 2010 Beta Using Outlook 1
P Setting Up HT Server; Questions Exchange Server Administration 3
M when acessing Ebay to answer questions, internet explorer aborts. please help as I can not run my store. thank you Using Outlook 1
Z FSW and DAG/DAC questions Exchange Server Administration 5
I Exchange 2010 transition questions Exchange Server Administration 9
P Archiving questions Exchange Server Administration 1
M Exchange 2010 for 5000 users - Storage Questions Exchange Server Administration 3
C import-mailbox in 2010 - questions on variables Exchange Server Administration 2
J Re: Exchange 2003 to 2010 Migration w/ Coexistence questions Exchange Server Administration 3
P Exchange 2003 to 2010 Migration w/ Coexistence questions Exchange Server Administration 4
S I just ned a couple questions answered.. Using Outlook 5
T Ribbon Control questions Outlook VBA and Custom Forms 7
K Scraping outlook emails (2 questions) Outlook VBA and Custom Forms 1
D BCM 2013 not functioning as BCM 2010 Example no drop down for communications history Using Outlook 0
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
S How to set a folder in inbox to receive email from specific account?__For example Inbox-Shanthu(subfolder) has to receive email from Email removed for Using Outlook 2
R Chat wants product code, no code matching the format of the example is on the box. Outlook does not delete downloaded email from the server, help is U Using Outlook 1
D Exchange 2010 Documentation- Exchange 2010 Mailbox Server Role Design Example Exchange Server Administration 5
Similar threads

















































Top