PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Outlook Script:How to: Search base on EntryID ?

Reply

Outlook Script:How to: Search base on EntryID ?

 
Thread Tools Rate Thread
Old 03-12-2007, 04:05 PM   #1
bbnimda
Guest
 
Posts: n/a
Default Outlook Script:How to: Search base on EntryID ?


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 ?




--
Knowlege grows when shared.

http://bensoft.miniville.fr/tra


  Reply With Quote
Old 03-12-2007, 04:20 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Outlook Script:How to: Search base on EntryID ?

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.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"bbnimda" <wahhhran-vba@yahoo.fr> wrote in message news:eHXagYcNIHA.1188@TK2MSFTNGP04.phx.gbl...
> 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 ?


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off