get phone no from addressbook

S

shubhangi

hello
I'm displaying AddressBook in Outlook 2007 (from VSTO Addin)with
App.GetNamespace("MAPI").GetSelectNamesDialog
The user is allowed to select only one entry.I want to get the selected
contact entry's corresponding phone
no. The selected contact entry say A B is shown in address book as
DisplayName
A B(Business Fax)
A B(Home Fax)
A B(Other Fax)

If the user select A B(Home Fax),I need to retrieve Home Fax no.Do I've to
get contact
from AddressENtry.GetContact & then check the selected contact entry from
addressbook with Contact's all types of
phone nos or any other way is there?

Thanks
 
K

Ken Slovak - [MVP - Outlook]

You would use SelectNamesDialog.Recipients.Item(1).AddressEntry.GetContact
to get the contact and from there you read any contact property you want.
 
S

shubhangi

Thanks for the reply
But I want to retrieve the selected phone number of selected contact from
AddressBook.My addressbook shows 3 entries for same contact-
DisplayName
A B(Business Fax)
A B(Home Fax)
A B(Other Fax)

If user selects entry A B(Home Fax) then I want home fax no of contact A
B.I get the
selected contact with
SelectNamesDialog.Recipients.Item(1).AddressEntry.GetContact
but how would I know that user has selected A B(Business Fax) or A B(Home
Fax) or
A B(Other Fax). ?
 
K

Ken Slovak - [MVP - Outlook]

You'll see something like "Joe Blow (Business Fax)" for Recipient.Name and
something like "Joe Blow@+1 (555) 555-5555" for Recipient.Address if it's a
fax number. You'll have to experiment with the return values with both
Exchange and non-Exchange profiles to see what's being returned in each
case.
 
S

shubhangi

Thanks,I'll experiment with that.

Ken Slovak - said:
You'll see something like "Joe Blow (Business Fax)" for Recipient.Name and
something like "Joe Blow@+1 (555) 555-5555" for Recipient.Address if it's
a fax number. You'll have to experiment with the return values with both
Exchange and non-Exchange profiles to see what's being returned in each
case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top