Friday, February 24, 2012

Tracking Meeting Request Events in Outlook

-Suresh Pitchai
Most of us use Outlook client application for mailing purpose where we also schedule meeting. The person who is going to organize the meeting will send request to the attendees. The receiver who receives the request may or may not accept the request. The sender will not be aware whether the meeting request has been accepted or declined by the receiver. In order to overcome this we have a mechanism for tracking the request and notify the sender.  
As I .Net Developer, I have written a small plug-in to solve this problem. I have achieved this by using the COM Component of ‘Microsoft. Office.Interop.Outlook’. This COM Component provides set of delegate events like ItemEvents_11, ApplicationEvents_11 etc., which has the methods ItemAdd, ItemChange, ItemRemove etc., In order to implement we can follow the below steps and sample code is given at the end.

Step 1: First get all appointments in Outlook Application. By using the below sample code , we get all the appointments of outlook application.

     NameSpace nameSpace = null;
     MAPIFolder calendar = null;
     Items outlookAppointments = null;
     public void OnStartupComplete(ref System.Array custom)
     {
      nameSpace = app.GetNamespace("mapi");
      nameSpace.Logon("", "", true, true);
      calendar = nameSpace.GetDefaultFolder
      (OlDefaultFolders.olFolderCalendar);
 outlookAppointments = calendar.Items;
     }
The above code is used to get all the appointment list objects. This object is stored in “outlookAppointments” items objects.

Step 2: Register the ItemAdd event in the “OnStartupComplete” Method

outlookAppointments.ItemAdd += new ItemsEvents_ItemAddEventHandler(outlookAppointments_ItemAdd)

The ItemsEvents_ItemAddEventHandler event is used to get the latest meeting request from your outlook application. The new meeting request added in your outlook, automatically triggers the “outlookAppointments_ItemAdd” method. Similarly to register the ItemChange, ItemRemove are as follows:

//this event trigger, when the meeting request change    
outlookAppointments.ItemChange += new ItemsEvents_ItemChangeEventHandler(outlookAppointments_ItemChange);

//this event trigger, when the meeting request decline or deleted.
outlookAppointments.ItemRemove += new ItemsEvents_ItemRemoveEventHandler(outlookAppointments_ItemRemove);


Step 3: Add the below method in your page.
       
       void outlookAppointments_ItemAdd(object Item)
     void outlookAppointments_ItemChange(object Item)
     void outlookAppointments_ItemRemove()

You can get details about the appointment body, duration, start time, end time, decline date, accepted date and etc., using the “item” object. The below sample code is used to get the some details.
          
     void outlookAppointments_ItemChange(object Item)
     {
      AppointmentItem appointment = (Item as AppointmentItem);
      string AppointmentDetails = string.Empty;
      AppointmentDetails = AppointmentDetails + "Subject :: " +
      appointment.Subject + "\r\n";
      AppointmentDetails = AppointmentDetails + "Body :: " +
      appointment.Body +     
      "\r\n";
      AppointmentDetails = AppointmentDetails + "Action :: " +
      appointment.Action.ToString() + "\r\n";
     }
This gives information about the receivers action.








6 comments:

data recovery services dallas said...

Marvelous work.Just wanted to drop a comment and say I am new to your blog and really like what I am reading.

Richard Majece said...

I am sure that only advices from https://essaydragon.com/blog/good-topic-sentences will help you to get a high grade. Here you can read a lot about topic sentences

Unknown said...

Case brief writing service https://topwritingservice.com/capstone-writing-service/ can help with all your assignments. Although different universities all around the world have introduced individual criteria to assess the welfare, performance, and development of their students, they also have similar regulations and fundamental rules for the evaluation of skills and knowledge.

Mark Jasmine said...

Are you unable to smooth-spoken your ideas? Unable to present them in a manner which can help them stand out? Then what you need is an best dissertation writing services near me, such as Dissertation Help Near Me. Their ‘do my dissertation UK’ feature is well-advised the world-class in the UK, due to the quality they permeate in their work ethic.

Rampage Coffee said...

Micro batch roasting of specific varieties of specialty strong coffee and then mixing them together was the answer! The best blends were developed and marketed under their name: Rampage Coffee Co. - the only one that is strong enough to start an RIOT, yet soft enough that it will keep returning to try more! Join us on this roasting experience and discover the distinct difference! Rampage Coffee Co. is run by and owned by Saskatoon, SK in Canada

Rave BBQ Rubs said...

Best beef rub can be divided into two categories that are spare ribs and short ribs. Spare ribs are found in the belly of the rib cage located just above the breastbone. In comparison to the well-known pork spare ribs, beef spare ribs tend to be longer, more wide and have a greater curvature. The tips on the upper end can be removed to create short ribs. Short ribs may also be derived from the brisket, plate and flanks of the cow. Short and spare ribs have connective tissue that is similar to brisket and requires slow and low cooking in order to soften and become succulent.