Getting Exchange Appointments by ICalUid?
Asked Answered
F

3

10

So I'm creating Exchange (2007) Appointments with a given ICalUid:

var app = new Appointment(svc);
app.ICalUid = id;
app.Subject = "Test Appointment";
app.Recurrence = new Recurrence.DailyPattern(DateTime.Now, 3);
app.RequiredAttendees.Add("[email protected]");
app.AllowNewTimeProposal = false;
app.Body = new MessageBody(BodyType.HTML, "This is a <b>Test!</b>");
app.Save();

Later on, I would like to update that appointment, at which point I need to find it through the ICalUid.

However, there seems to be no way to do that? I can use Appointment.Bind only against the Exchange ID, which I don't have at the time of update (storing it is highly impractical)

I can create a new appointment with the same ICalUid, which seems to behave like an update, but asks to Accept/Reject again instead of just displaying "No Update Required".

Is there any proper way to do that?

Fenrir answered 14/7, 2012 at 0:24 Comment(0)
F
1

Doesn't seem that 2007 has a way at all.

Fenrir answered 22/7, 2012 at 23:1 Comment(0)
L
8

You can use a ExchangeService.FindItems to search for the Appointment with the ICalUid - see the example below. Note though, it has a problem finding Appointments that are recurring.

See:

Shame you aren't using Exchange 2010, as there is a getICalUID() in EWS Managed API 1.1.5.

Here are some other links that may allow you to get a more satisfactory solution.

Liggett answered 17/7, 2012 at 11:28 Comment(7)
Thanks, that doesn't seem to find it though, even if I remove the recurrence :( In what format should the ICalUid be? I've been using a Guid before,but that throws an exception in the GetObjectIdStringFromUid method. Using a hex string like 012345 doesn't throw an exception, but doesn't find the appointment either.Fenrir
I think you have to encode it as Base64 - it's mentioned in one of the links..social.technet.microsoft.com/Forums/en/exchangesvrdevelopment/…Liggett
That doesn't do it either :( Looking with OutlookSpy, I can't see the iCalUid in any of the fields either, but that doesn't need to mean much. Still, Exchange doesn't seem to find it.Fenrir
Could you expand your example code a bit more ? e.g. show us what your id looks like....are you just generating a unique GUID on the fly each time ? Do you use a GUID string that includes the dashes? or do you strip them out? Maybe you should specify just the HEX codes for the id when you create the Appointment e.g. 000C020304etc. Finally, look at this....d-push.sourcearchive.com/documentation/1.5.3-1/… ....might give some clues.Liggett
Here's an alternative example that is doing the FindItems. archive.cnblogs.com/a/2173625Liggett
And one final link: infini-tec.de/post/2009/04/13/…Liggett
I know this is old, but this is an example of why you should post code not links. All of these are dead links apart from last comment link.Fireball
S
3

check the two FindAppointments methods of ExchangeService

http://msdn.microsoft.com/en-us/library/dd635918(v=exchg.80)

http://msdn.microsoft.com/en-us/library/dd633767(v=exchg.80)

Sandler answered 21/7, 2012 at 20:57 Comment(2)
That doesn't seem to have any way to specify a filter for the iCal UID (or anything else)Fenrir
Yes the only search method available seem to be by date range. What contextual information regarding the appointment do you have when you need to make an update? Could you do a search by date, then iterate through the results until you find your ID? Not great I know.Sandler
F
1

Doesn't seem that 2007 has a way at all.

Fenrir answered 22/7, 2012 at 23:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.