PC Review


Reply
Thread Tools Rate Thread

Contact Email address format

 
 
JohnLee
Guest
Posts: n/a
 
      24th May 2010
Hi!

I'm trying to programmatically access the my contacts from outlook, which I
did using the following code:

var outlookApplication = new ApplicationClass();

NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI");

MAPIFolder searchFolder =
mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);



The problem is that any email address (Email1Address) retrieved which is
connected to the same local Microsoft exchange server is retrieved in the
following format:

/o=First Organization/ou=Exchange Administrative Group
(FYDIBHDO23SPDLT)/cn=Recipients/cn=John Lee



Is it possible to retrieve or somehow convert the address to the usual email
format ((E-Mail Removed)) ?

I need to retrieve the certificate linked to the particular email, but as
far as I know it can only be correctly matched by searching by email address
(using the format (E-Mail Removed)).

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      24th May 2010
Outlook version?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"JohnLee" wrote:

> Hi!
>
> I'm trying to programmatically access the my contacts from outlook, which I
> did using the following code:
>
> var outlookApplication = new ApplicationClass();
>
> NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI");
>
> MAPIFolder searchFolder =
> mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
>
>
>
> The problem is that any email address (Email1Address) retrieved which is
> connected to the same local Microsoft exchange server is retrieved in the
> following format:
>
> /o=First Organization/ou=Exchange Administrative Group
> (FYDIBHDO23SPDLT)/cn=Recipients/cn=John Lee
>
>
>
> Is it possible to retrieve or somehow convert the address to the usual email
> format ((E-Mail Removed)) ?
>
> I need to retrieve the certificate linked to the particular email, but as
> far as I know it can only be correctly matched by searching by email address
> (using the format (E-Mail Removed)).
>

 
Reply With Quote
 
JohnLee
Guest
Posts: n/a
 
      24th May 2010
At the moment I'm working on outook 2007...

"Sue Mosher [MVP]" <(E-Mail Removed)> wrote in message
news:CC6C7B6F-A0E6-4491-8127-(E-Mail Removed)...
> Outlook version?
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
>
> "JohnLee" wrote:
>
>> Hi!
>>
>> I'm trying to programmatically access the my contacts from outlook, which
>> I
>> did using the following code:
>>
>> var outlookApplication = new ApplicationClass();
>>
>> NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI");
>>
>> MAPIFolder searchFolder =
>> mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
>>
>>
>>
>> The problem is that any email address (Email1Address) retrieved which is
>> connected to the same local Microsoft exchange server is retrieved in the
>> following format:
>>
>> /o=First Organization/ou=Exchange Administrative Group
>> (FYDIBHDO23SPDLT)/cn=Recipients/cn=John Lee
>>
>>
>>
>> Is it possible to retrieve or somehow convert the address to the usual
>> email
>> format ((E-Mail Removed)) ?
>>
>> I need to retrieve the certificate linked to the particular email, but as
>> far as I know it can only be correctly matched by searching by email
>> address
>> (using the format (E-Mail Removed)).
>>


 
Reply With Quote
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      24th May 2010
For Outlook 2007 or later, once you get the address from the contact in X.400
(Exchange) format, use it as the argument for the Namespace.CreateRecipient
method to return a Recipient object. Then use the
Recipient.AddressEntry.GetExchangeUser method to return an ExchangeUser
object and get its PrimarySmtpAddress address:

Set recip = mapiNamespace.CreateRecipient(contactemail)
If recip.Resolved Then
Set ae = recip.AddressEntry
If ae.AddressEntryUserType = olExchangeUserAddressEntry Then
Set exUser = ae.GetExchangeUser
smtp = exUser.PrimarySmtpAddress
End If
End If
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"JohnLee" wrote:

> At the moment I'm working on outook 2007...
> >>
> >> I'm trying to programmatically access the my contacts from outlook, which
> >> I
> >> did using the following code:
> >>
> >> var outlookApplication = new ApplicationClass();
> >>
> >> NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI");
> >>
> >> MAPIFolder searchFolder =
> >> mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
> >>
> >> The problem is that any email address (Email1Address) retrieved which is
> >> connected to the same local Microsoft exchange server is retrieved in the
> >> following format:
> >>
> >> /o=First Organization/ou=Exchange Administrative Group
> >> (FYDIBHDO23SPDLT)/cn=Recipients/cn=John Lee
> >>
> >>
> >>
> >> Is it possible to retrieve or somehow convert the address to the usual
> >> email
> >> format ((E-Mail Removed)) ?
> >>
> >> I need to retrieve the certificate linked to the particular email, but as
> >> far as I know it can only be correctly matched by searching by email
> >> address
> >> (using the format (E-Mail Removed)).
> >>

>

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contact Email address format JohnLee Microsoft Outlook Contacts 3 24th May 2010 02:37 PM
Upon receipt of email, Outlook XP changes Contact Sender name to first Contact with the email address associated with the Contact name Paul Billings Microsoft Outlook Contacts 1 11th Nov 2004 10:10 AM
email address format in contact Tom Dawson Microsoft Outlook Contacts 7 26th Nov 2003 03:14 PM
Import Contact with EX format email address Jia Li Microsoft Outlook Discussion 0 21st Oct 2003 09:33 PM
Import Contact with EX format email address Jia Li Microsoft Outlook Interoperability 0 21st Oct 2003 09:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:54 PM.