Click here to Skip to main content
15,887,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I have developed a VSTO add-in for Outlook (2007 & 2003) using VS 2008. The thing is how can I differentiate between an appointment that has been sent to the recipients and one that has only been saved and closed (not sent). The thing is I have to set a flag in the DB representing the appointment that was actually used / sent, but as mentioned I'm having trouble distinguishing between the appointments.

Many thanks in advance.
Kind regards,
Posted

You can check "Outlook.Recipient" count. (Count is a valid property of Recipient object.)
If it is greater than 1, you can take it as sent or else just saved and closed.
 
Share this answer
 
Although Sandeep has a valid point, a situation may exist where an user creates an appointment with boardrooms / recipients and decides to save and then close the appointment without sending it.

I have checked the Item properties of the appointment item and noticed that the following values are only acquired when the send button is clicked:

Name: ConversationIndex - Type: olText
Name: EntryID - Type: olText
Name: GlobalAppointmentID - Type: olText

I think this might be the answer but I am not sure :confused:

Kind regards,
 
Share this answer
 
Answer from: Ken Slovak [MVP - Outlook]


What you're missing is what you're going to run into with methods/events
that overload the same keyword in all managed code. In this case
AppointmentItem doesn't directly expose the Send event since it uses the
same keyword as the Send method.

There are a couple of ways to do what you need to do:

1. Declare at class level an ItemEvents_Event object, say _apptEvents:
private Outlook.ItemEvents_Event _apptEvents;

Then instantiate the event handler so:
_apptEvents = (Outlook.ItemEvents_Event)_appt;
_apptEvents.Send += new Outlook.ItemEvents_SendEventHandler(myHandler);

2. An alternative is to use AppointmentItemClass:
private Outlook.AppointmentItemClass _itemClass; // class level

Then instantiate as follows:
_itemClass = (Outlook.AppointmentItemClass) _appt;
_itemClass.ItemEvents_10_Event_Send += etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900