Question

I'm going crazy on this one. Basically I want to retrieve a task based on the EntryID of this task. so what I do is the following:

Outlook.MAPIFolder outlookTasksFolder = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks); string filter = String.Format("@SQL=\"urn:schemas:tasks:entryid\" like '%{0}%'", myEntryID); Outlook.Items outlookTasksDataItems = outlookTasksFolder.Restrict(filter);

but i does not work. I don't know how to format my query to get the corresponding items (there should be only one really).

can anyone please help me? thank you

Was it helpful?

Solution

Outlook.MAPIFolder outlookTasksFolder = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks);

Outlook.TaskItem myOutlookTask = (Outlook.TaskItem)Application.Session.GetItemFromID(myEntryID, outlookTasksFolder.EntryId);

That should do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top