views:

271

answers:

1

Hi, 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

+1  A: 

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

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

That should do it.

Jake Ginnivan
that's what i finally did.and it worked fine.thank you very much.
jeremy