Outlook Script:How to: Search base on EntryID ?

  • Thread starter Thread starter bbnimda
  • Start date Start date
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 ?
 
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.
 
Back
Top