I have a outlook VSTO addin and I am able to retrieve a list of calendar appointments by using this code:
private Items GetAppointmentsInRange(Folder folder, DateTime startTime, DateTime endTime)
{
string filter = "[Start] >= '"
+ startTime.ToString("g")
+ "' AND [End] <= '"
+ endTime.ToString("g") + "'";
Debug.WriteLine(filter);
try
{
Items calItems = folder.Items;
calItems.IncludeRecurrences = true;
calItems.Sort("[Start]", Type.Missing);
Items restrictItems = calItems.Restrict(filter);
if (restrictItems.Count > 0)
{
return restrictItems;
}
else
{
return null;
}
}
catch
{
return null;
}
}
and I can loop through this appointmentitems and get the entryId which i am told is the unique identifier for that series.
I am now trying to figure out, given an EntryId, what is the right code to get a direct reference to the appointmentItem series (without having to do a search for everything and filter on the "client side"
Is this possible in outlook vsto?
Application.GetNamespace("MAPI").GetItemFromID(entryIDForAppointment, EntryIdForStore)
. The store is the mailbox that you are dealing with. If you have any folder in the mailbox, you can usefolder.StoreID
to get the entry id for the store. – Yacoub Massad