Outlook Script:How to: Search base on EntryID ?

B

bbnimda

Outlook 2003 + Sbs 2003

Hi All,

I'm trying to make a search using entry ID, but I didn't success



here's my code

Set myFolder =
Application.GetNamespace("MAPI").Folders("").Folders("").......

Set myItems = myFolder.Items

strFind = "[EntryID]= " & Chr(34) & iDSoc & Chr(34)

set myItem = myItems.Find(strFind)

If not (myItem Is Nothing) then

=> here i realise my condition if I found my contact

end if



What's wrong with my code ?
 
S

Sue Mosher [MVP-Outlook]

If you read the Help topic on Find, you'll see that EntryID is not a field available for use with the Find method. Instead, use the Namespace.GetItemFromID method. If you have reason to expect it to be in a non-default store, iterate Namespace.Folders and get the StoreID from each store and try it with GetItemFromID.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top