find sender info

Status
Not open for further replies.
R

RWR3YXJk

Hi everybody,

I know how to get sender's name programatically but I don't know how to get

additional infor like (Office,department) , We use outlook 2003 and exchange

server each person has those additional inofmration in his/her global address

list

Best regards,

Edward
 
D

Dmitry Streblechenko

If you are using the Outlook Obejct Model, you best bet is probably to take

the value of the MailItem.SenderEmailAddress property and use it to call

Namespace.CreateRecipient, followed by Recipient.Resolve. You should then be

able to access the Recipeint.AddressEntry objeect.

Strictly speaking, no name/address/etc resolution is necessary since the

message already contains the sender entry id (PR_SENDER_ENTRYID MAPI

property), but OOM does not expose it.

<plug> Redemption woudl let you directly access the sender properties

through the RDOMail.Sender property </plug

Dmitry Streblechenko (MVP)

-

"Edward" <Edward> wrote in message

news:0F1235ED-6707-45EF-B7E1-19558844044D@microsoft.com...
> Hi everybody,
> I know how to get sender's name programatically but I don't know how to
> get
> additional infor like (Office,department) , We use outlook 2003 and
> exchange
> server each person has those additional inofmration in his/her global
> address
> list
> > Best regards,
> Edward
 
R

RWR3YXJk

Thanks

I got up to this point

Dim myolApp As Outlook.Application

Dim myNamespace As Outlook.NameSpace

Dim myRecipient As Outlook.Recipient

Set myolApp = CreateObject("Outlook.Application")

Set myNamespace = myolApp.GetNamespace("MAPI")

Set myRecipient = myNamespace.CreateRecipient(msg.SenderEmailAddress)

'myRecipient.Resolve

myRecipient.AddressEntry

But I can't find the office location based on AddressEntry, Office location

is in contacts and I'm not sure how to continue this code ?

Any siggestions?

Best regards,

Edward

"Dmitry Streblechenko" wrote:


> If you are using the Outlook Obejct Model, you best bet is probably to take
> the value of the MailItem.SenderEmailAddress property and use it to call
> Namespace.CreateRecipient, followed by Recipient.Resolve. You should then be
> able to access the Recipeint.AddressEntry objeect.
> Strictly speaking, no name/address/etc resolution is necessary since the
> message already contains the sender entry id (PR_SENDER_ENTRYID MAPI
> property), but OOM does not expose it.
> <plug> Redemption woudl let you directly access the sender properties
> through the RDOMail.Sender property </plug
> > Dmitry Streblechenko (MVP)
>

>

>

> -
> "Edward" <Edward> wrote in message
> news:0F1235ED-6707-45EF-B7E1-19558844044D@microsoft.com...
> > Hi everybody,
> > I know how to get sender's name programatically but I don't know how to
> > get
> > additional infor like (Office,department) , We use outlook 2003 and
> > exchange
> > server each person has those additional inofmration in his/her global
> > address
> > list
> > > > Best regards,
> > Edward


>
 
D

Dmitry Streblechenko

What version of Outlook are you using?

Dmitry Streblechenko (MVP)

-

"Edward" <Edward> wrote in message

news:5897771C-1BB3-4D08-8203-03CC2A74CFD1@microsoft.com...
> Thanks
> I got up to this point

> Dim myolApp As Outlook.Application
> Dim myNamespace As Outlook.NameSpace
> Dim myRecipient As Outlook.Recipient
> Set myolApp = CreateObject("Outlook.Application")
> Set myNamespace = myolApp.GetNamespace("MAPI")
> Set myRecipient = myNamespace.CreateRecipient(msg.SenderEmailAddress)
> 'myRecipient.Resolve
> myRecipient.AddressEntry

> But I can't find the office location based on AddressEntry, Office
> location
> is in contacts and I'm not sure how to continue this code ?
> Any siggestions?

> > Best regards,
> Edward

> "Dmitry Streblechenko" wrote:
>
> > If you are using the Outlook Obejct Model, you best bet is probably to
> > take
> > the value of the MailItem.SenderEmailAddress property and use it to call
> > Namespace.CreateRecipient, followed by Recipient.Resolve. You should then
> > be
> > able to access the Recipeint.AddressEntry objeect.
> > Strictly speaking, no name/address/etc resolution is necessary since the
> > message already contains the sender entry id (PR_SENDER_ENTRYID MAPI
> > property), but OOM does not expose it.
> > <plug> Redemption woudl let you directly access the sender properties
> > through the RDOMail.Sender property </plug
>
>> > > Dmitry Streblechenko (MVP)
> >

> >

> >

> > -
> > "Edward" <Edward> wrote in message
> > news:0F1235ED-6707-45EF-B7E1-19558844044D@microsoft.com...
> > > Hi everybody,
> > > I know how to get sender's name programatically but I don't know how to
> > > get
> > > additional infor like (Office,department) , We use outlook 2003 and
> > > exchange
> > > server each person has those additional inofmration in his/her global
> > > address
> > > list
> > > > > > Best regards,
> > > Edward

>

>
>>
 
R

RWR3YXJk

Thanks,

I use 2003, but we may switch to 2007 in the future.

Best regards,

Edward

"Dmitry Streblechenko" wrote:


> What version of Outlook are you using?

> > Dmitry Streblechenko (MVP)
>

>

>

> -
> "Edward" <Edward> wrote in message
> news:5897771C-1BB3-4D08-8203-03CC2A74CFD1@microsoft.com...
> > Thanks
> > I got up to this point
> > Dim myolApp As Outlook.Application
> > Dim myNamespace As Outlook.NameSpace
> > Dim myRecipient As Outlook.Recipient
> > Set myolApp = CreateObject("Outlook.Application")
> > Set myNamespace = myolApp.GetNamespace("MAPI")
> > Set myRecipient = myNamespace.CreateRecipient(msg.SenderEmailAddress)
> > 'myRecipient.Resolve
> > myRecipient.AddressEntry
> > But I can't find the office location based on AddressEntry, Office
> > location
> > is in contacts and I'm not sure how to continue this code ?
> > Any siggestions?
> > > > Best regards,
> > Edward
> > "Dmitry Streblechenko" wrote:
> >
> >> If you are using the Outlook Obejct Model, you best bet is probably to
> >> take
> >> the value of the MailItem.SenderEmailAddress property and use it to call
> >> Namespace.CreateRecipient, followed by Recipient.Resolve. You should then
> >> be
> >> able to access the Recipeint.AddressEntry objeect.
> >> Strictly speaking, no name/address/etc resolution is necessary since the
> >> message already contains the sender entry id (PR_SENDER_ENTRYID MAPI
> >> property), but OOM does not expose it.
> >> <plug> Redemption woudl let you directly access the sender properties
> >> through the RDOMail.Sender property </plug
> >
> >> > >> Dmitry Streblechenko (MVP)
> >>

> >>

> >>

> >> -
> >> "Edward" <Edward> wrote in message
> >> news:0F1235ED-6707-45EF-B7E1-19558844044D@microsoft.com...
> >> > Hi everybody,
> >> > I know how to get sender's name programatically but I don't know how to
> >> > get
> >> > additional infor like (Office,department) , We use outlook 2003 and
> >> > exchange
> >> > server each person has those additional inofmration in his/her global
> >> > address
> >> > list
> >> > > >> > Best regards,
> >> > Edward
> >
> >
> >>


>
 
D

Dmitry Streblechenko

If you are using Outlook 2007, you can use PropertyAccessor to read the

PR_SENT_REPRESENTING_ENTRYID property

(http://schemas.microsoft.com/mapi/proptag/0x00410102). You can then use its

value to call Namespace.GetAddressEntryFromId.

Once you have AddressEntryObject, you can call AddressEntry.GetExchangeUser

to get the ExchangeUser object.

Or use AddressEntry.PropertyAccessor to read any raw MAPI properties

directly.

Dmitry Streblechenko (MVP)

-

"Edward" <Edward> wrote in message

news:7B98A0D9-C7F8-4F7D-896A-A2307F9049CE@microsoft.com...
> Thanks,
> I use 2003, but we may switch to 2007 in the future.
> > Best regards,
> Edward

> "Dmitry Streblechenko" wrote:
>
> > What version of Outlook are you using?
>

>> > > Dmitry Streblechenko (MVP)
> >

> >

> >

> > -
> > "Edward" <Edward> wrote in message
> > news:5897771C-1BB3-4D08-8203-03CC2A74CFD1@microsoft.com...
> > > Thanks
> > > I got up to this point
> >> > Dim myolApp As Outlook.Application
> > > Dim myNamespace As Outlook.NameSpace
> > > Dim myRecipient As Outlook.Recipient
> > > Set myolApp = CreateObject("Outlook.Application")
> > > Set myNamespace = myolApp.GetNamespace("MAPI")
> > > Set myRecipient =
> > > myNamespace.CreateRecipient(msg.SenderEmailAddress)
> > > 'myRecipient.Resolve
> > > myRecipient.AddressEntry
> >> > But I can't find the office location based on AddressEntry, Office
> > > location
> > > is in contacts and I'm not sure how to continue this code ?
> > > Any siggestions?
> >> > > > > Best regards,
> > > Edward
> >>> > "Dmitry Streblechenko" wrote:
> >> >> If you are using the Outlook Obejct Model, you best bet is probably to
> > >> take
> > >> the value of the MailItem.SenderEmailAddress property and use it to
> > >> call
> > >> Namespace.CreateRecipient, followed by Recipient.Resolve. You should
> > >> then
> > >> be
> > >> able to access the Recipeint.AddressEntry objeect.
> > >> Strictly speaking, no name/address/etc resolution is necessary since
> > >> the
> > >> message already contains the sender entry id (PR_SENDER_ENTRYID MAPI
> > >> property), but OOM does not expose it.
> > >> <plug> Redemption woudl let you directly access the sender properties
> > >> through the RDOMail.Sender property </plug
>> >
>> >> > > >> Dmitry Streblechenko (MVP)
> > >>

> > >>

> > >>

> > >> -
> > >> "Edward" <Edward> wrote in message
> > >> news:0F1235ED-6707-45EF-B7E1-19558844044D@microsoft.com...
> > >> > Hi everybody,
> > >> > I know how to get sender's name programatically but I don't know how
> > >> > to
> > >> > get
> > >> > additional infor like (Office,department) , We use outlook 2003 and
> > >> > exchange
> > >> > server each person has those additional inofmration in his/her
> > >> > global
> > >> > address
> > >> > list
> > >> > > > >> > Best regards,
> > >> > Edward
> > >
>> >
>> >>

>

>
>>
 
Status
Not open for further replies.
Top