Solved

Searching Outlook 2010 Meeting Request Events c#

Posted on 2011-03-13
13
739 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Outlook Archive File 3 37
comparing string in C# 3 33
Image(2) 3 22
cached or not 5 39
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now