Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Searching Outlook 2010 Meeting Request Events c#

Posted on 2011-03-13
13
Medium Priority
?
814 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
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

782 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