Solved

Searching Outlook 2010 Meeting Request Events c#

Posted on 2011-03-13
13
758 Views
Last Modified: 2012-05-11
I will check in Outlook (for Outlook Addin), in a meeting request (MeetingItem / AppointmentItem), the recipients when they were added.
So far I have not found any event, which add to the recipients is responsible.
Can someone give me as a tip on how I should proceed?

Thank you
Martin
0
Comment
Question by:Martin Kreis
  • 8
  • 5
13 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35121398
SOunds like you want the item add event to the calendar folder.  Whilst i'm not C# aware, it is the outlook 'way'.  See:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.itemsevents_event.itemadd.aspx#Y180

Chris
0
 

Author Comment

by:Martin Kreis
ID: 35122736
Hi Chris
No, not the ItemLoad event in the Outlook Explorer, this Event i know, also how to decide if it is the right item for me.
I am searching for an event / possibility in the MeetingItem / AppointmentItem it self...

Thanks
Martin
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35123215
Ah in that case apologies for my error, there is an item change event if you set a withevents handler but I have less than no idea how you can use it via c# or even if you can use it.

Chris

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:Martin Kreis
ID: 35132630
I have figured out how do I know if the recipients have been changed, that event fires on any change in the appointmentItem, but i am able to filter with the name.

        readonly Outlook.Application _outlookApp = new Outlook.Application();

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            _outlookApp.ItemLoad += new Outlook.ApplicationEvents_11_ItemLoadEventHandler(test_ItemLoad);
        }

        void test_ItemLoad(object item)
        {
            if (item is Outlook.AppointmentItem)
            {
                var appt = item as Outlook.AppointmentItem;
                appt.PropertyChange += new ItemEvents_10_PropertyChangeEventHandler(appt_PropertyChange);
            }
        }

        void appt_PropertyChange(string name)
        {
            MessageBox.Show(string.Format("Name: {0}", name));
            xxx
        }

Open in new window


xxx: Here I'd just like to go through now the recipients of the item, if it has changed. Unfortunately, I do not know how to get back to my Appointment Item ....

Thanks
Martin
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35132719
Congratulations on getting that far .. it isn't the first time I have overlooked the load event!

I still don't know c# or the interop interface :o(

BUt what do you get from your appt_PropertyChange handler if you change the recipients?

Chris
0
 

Author Comment

by:Martin Kreis
ID: 35132791
Sadly, i only get the name of the Properties which has been changed...
Now, if i see, that the recipients has changed, i like to go thru this an check the Place of the recipients...

Cheers
Martin
0
 

Author Comment

by:Martin Kreis
ID: 35132851
It seems that not many really develop for Office or Outlook add-in ...
Not easy to find help ...
0
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 150 total points
ID: 35132856
IN test_ItemLoad you have the appointmentitem as item .. it would seem

                var appt = item as Outlook.AppointmentItem;

so can you access the item here to see the recipients?

Chris
0
 

Author Comment

by:Martin Kreis
ID: 35155933
Hi Chris
Not in the ItemLoad Event. But i try it with ItemSend event, and there i can Access to the recipients.

Martin
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35156291
OK, if that's the case it would indicate you cannot check the recipients during the load event ... strange as it seems to me.  The mail you used to 'load' was a mail with recipients?

Chris
0
 

Author Comment

by:Martin Kreis
ID: 35187056
Hi Chris
Its not an E-Mail, its an Appointment / MeetingItem.
But for the moment, its ok to work with the ItemSend event.

Thanks
Martin
0
 

Accepted Solution

by:
Martin Kreis earned 0 total points
ID: 35187110
As example, this piece of code i use...
        readonly Outlook.Application _outlookApp = new Outlook.Application();

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            _outlookApp.ItemSend += new ApplicationEvents_11_ItemSendEventHandler(OutlookAppItemSend);
        }

        void OutlookAppItemSend(object item, ref bool cancel)
        {
            if (item is Outlook.AppointmentItem)
            {
                var appt = item as Outlook.AppointmentItem;
                foreach (Outlook.Recipient recipient in appt.Recipients)
                {
                    MessageBox.Show(string.Format("Rctp {0} ", recipient.Name));
                }

            }
....

Open in new window

0
 

Author Closing Comment

by:Martin Kreis
ID: 35221393
Found no solution for the asked question but found an other way by self.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question