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
 
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
 
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


>
 
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

>

>
>>
 
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
> >
> >
> >>


>
 
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.
Similar threads
Thread starter Title Forum Replies Date
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
B Find related messages to sender Outlook VBA and Custom Forms 7
B Find Related Emails to sender Using Outlook 1
D Outlook 2007 Find All Related and Messages From Sender not working Using Outlook 3
T Find the sender who sent the mail from Generic Mailbox. Using Outlook 4
W I have to find the sender's email address Outlook VBA and Custom Forms 2
S Related messages show in main Outlook window vice new Advanced Find windows Using Outlook 1
mrrobski68 Issue with Find messages in a conversation macro Outlook VBA and Custom Forms 1
O How to find out the domain and server settings that my Outlook is using? Using Outlook 2
T How to find or display the sub-folder name for an Archive Search Using Outlook 10
Bardiferous Weird Contacts Behavior - Can't find any in any address book, but they're in there Using Outlook 3
J search doesn't find anything Using Outlook 1
M Issues with templates - unable to find in old web app Using Outlook 3
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
Witzker How to find all emails from and to a contact in OL 2019 Using Outlook 6
S How to find emails that I sent that have not received a reply? Using Outlook 7
M How can we find the list of users who are members of a deleted distribution list? Exchange Server Administration 2
N Disable Auto Read Receipts sent after using Advanced Find Using Outlook 4
H Outlook 2003 find by "has attachment" Using Outlook 1
geoffnoakes Find Contacts with UDFs "in this item" Using Outlook 1
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
B Outlook 2010 Can not find a certain file in M/S Outlook 2010. Using Outlook 1
T "cannot find the calendar folder for this item" - calendar items stuck in outbox Using Outlook 0
S Find a cell value in excel using outlook vba Using Outlook 1
B Search: Cannot find which Folder Contains a Message Using Outlook 3
K How to find specific header and copy the mail body Using Outlook 0
Hudas VBA find and open an email without looping thru each email in the inbox Outlook VBA and Custom Forms 1
E How to find or recover Lost e-mails within a folder under Inbox? Using Outlook 2
H "Advanced find: column for full folder path? Using Outlook 1
M What is the best way to find all records of an e-mail for our company? Outlook VBA and Custom Forms 2
C Find all deleted recurrence appointments Outlook VBA and Custom Forms 4
mrje1 Is there a Find and Replace feature in Outlook 2016? Using Outlook 4
G Can't find contacts entered Using Outlook 0
Connie Boyer Exporting Outlook calendar/find next repeating meeting Using Outlook 3
RBLampert Outlook "can't find" my e-mail server to receive messages Using Outlook 22
M Can't find messages Using Outlook 4
Diane Poremsky Find the Distribution Lists a Contact Belongs to Using Outlook 0
T Macro to find contacts by category and copy them to another folder Outlook VBA and Custom Forms 15
thomas zaleski Cannot find the Sending FOlder Using Outlook 2
J Find and Highlight text in outlook Outlook VBA and Custom Forms 4
J Outlook Mailbox cleanup; any way to change limit to find items older 999 days? Exchange Server Administration 2
F Disable "Find related messages" Using Outlook 1
Jennifer Murphy Can't delete or even find task attachment Using Outlook 1
K Re: Use Instant search to find messages from a contact Outlook VBA and Custom Forms 6
Andrew Hawkins "Advanced Find" Using Outlook 1
M BCM 2007 Can't find SS2012Express Using Outlook 2
O Outlook 2013 contacts - Where to find "Display as"-field Using Outlook 2
A Advanced find query facilty Help please Using Outlook 2

Similar threads

Back
Top