Group:  Microsoft Outlook » microsoft.public.outlook.program_addins
Thread: Recipients & Contacts

Geek News

Recipients & Contacts
"David Cebrian" <david_cebrian[ at ]msn.com> 2/9/2006 12:45:40 PM
Hello everybody !!!

Is there any way to obtain a contact item from the recipient of a mail
item???

It is very important for me.

Thanks for all.


Re: Recipients & Contacts
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/9/2006 2:36:53 PM
Sort of but not really is the best answer. If the recipient isn't a one-off
recipient and does live in a contacts folder the usual thing is to get the
name and search any contacts folder (using Find or Restrict) to locate a
contact with that name. You can also use something like email address but of
course then you have to filter on all 3 and reading email addresses is
subject to the object model guard if the code isn't trusted or if you don't
use a method to avoid the security prompts, such as Redemption
(www.dimastr.com/redemption).

However, there's another (undocumented) way to do this. Get the EntryID of
the Recipient.AddressEntry object and hack out part of that string to get
the EntryID of the contact item.

The code would look something like this:

strID = oAddressEntry.ID
strID = Right(strID, Len(strID) - 72)
strID = Left(strID, Len(strID) - 6)

I hacked this out a while ago, so test it. The best way is with a MAPI tool
such as OutlookSpy (www.dimastr.com) or MFCMAPI (from MS). You can use that
to play with EntryID's and the pattern of the contact ID within the
AddressEntry ID.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"David Cebrian" <david_cebrian[ at ]msn.com> wrote in message
news:OkPxFaXLGHA.2216[ at ]TK2MSFTNGP09.phx.gbl...
[Quoted Text]
> Hello everybody !!!
>
> Is there any way to obtain a contact item from the recipient of a mail
> item???
>
> It is very important for me.
>
> Thanks for all.
>
>

Re: Recipients & Contacts
"David Cebrian" <david_cebrian[ at ]msn.com> 2/9/2006 4:21:29 PM
Thank you very much.

this answer save me of a lot of problems.

Thank you again.

"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> escribió en el mensaje
news:ugaCTZYLGHA.964[ at ]tk2msftngp13.phx.gbl...
[Quoted Text]
> Sort of but not really is the best answer. If the recipient isn't a
one-off
> recipient and does live in a contacts folder the usual thing is to get the
> name and search any contacts folder (using Find or Restrict) to locate a
> contact with that name. You can also use something like email address but
of
> course then you have to filter on all 3 and reading email addresses is
> subject to the object model guard if the code isn't trusted or if you
don't
> use a method to avoid the security prompts, such as Redemption
> (www.dimastr.com/redemption).
>
> However, there's another (undocumented) way to do this. Get the EntryID of
> the Recipient.AddressEntry object and hack out part of that string to get
> the EntryID of the contact item.
>
> The code would look something like this:
>
> strID = oAddressEntry.ID
> strID = Right(strID, Len(strID) - 72)
> strID = Left(strID, Len(strID) - 6)
>
> I hacked this out a while ago, so test it. The best way is with a MAPI
tool
> such as OutlookSpy (www.dimastr.com) or MFCMAPI (from MS). You can use
that
> to play with EntryID's and the pattern of the contact ID within the
> AddressEntry ID.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "David Cebrian" <david_cebrian[ at ]msn.com> wrote in message
> news:OkPxFaXLGHA.2216[ at ]TK2MSFTNGP09.phx.gbl...
> > Hello everybody !!!
> >
> > Is there any way to obtain a contact item from the recipient of a mail
> > item???
> >
> > It is very important for me.
> >
> > Thanks for all.
> >
> >
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net