Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Specific Tasks In Outlook
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Finding Specific Tasks In Outlook
Miscellaneous
Thread ID:
00678837
Message ID:
00678837
Views:
65
Hello,

I'm writing a small program to synchronize items between an in-house helpdesk system and Outlook's Tasks folder.

At the beginning of the program, I open the Outlook Tasks Folder (programatically) and loop through all the tasks inspecting those that have a user defined property that indicates that the task is a Help Desk item. I create a record in a temp cursor that includes the HelpDesk item's id as well as the tasks entryid property from Outlook.

* Build Cursor Of HelpDesk Tasks Existing In Outlook
CREATE CURSOR oltasks (ticketid C(6), entryid M)
FOR x = 1 TO oFolder.Items.Count
oTask = oFolder.Items.Item(x)
oParm = oTask.UserProperties.Find("TicketID")
IF !ISNULL(oParm)
* insert record into table
INSERT INTO oltasks VALUES (oParm.Value, oTask.EntryId)
ENDIF
ENDFOR

As I syncronize, I didn't want to have to loop through all the open tasks in the Outlook Task Folder when only a few of them apply to the help desk. Using the process above gave me a cursor of just the tasks I'm interested in and something that I can index.

However, I wanted to be able to quickly find these tasks in Outlook later. I was planning on using the Find method of the Folder's Items object. However, the Find method apparently won't work with the EntryID property. (Why? I have no idea.)

* This is what I tried
SCAN
oTask = oFolder.Items.Find("[EntryID]='"+TRIM(temp.entryid)+"'")
IF !ISNULL(oTask) AND !ISNULL(oTask.UserProperties.Find("TicketID"))
oTask.Delete
ENDIF
ENDSCAN

Is there any other way of uniquely referencing a specific Task Item without having to loop through them all? Is there a way of doing a find based on a user defined property ... I couldn't see a way based on the object model. In other words, some way that I could find a Task item based on the Help Desk's ID for that task rather than Outlook's Id?

Thanks so much for your help.

Rodd
Next
Reply
Map
View

Click here to load this message in the networking platform