Solved

Searching Outlook 2010 Meeting Request Events c#

Posted on 2011-03-13
13
788 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

726 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