How to link Contact and Exchange User (GAL)

O

Olivier Lemonnier

Hi All,
I know how to create Exchange contact in mailbox but I can’t link my contact to a Exchange Mailbox (Global Access List).


RDOMail item = folder.Items.Add("IPM.Contact");
RDOContactItem contact = (RDOContactItem)item;
contact.Email1AddressType = “EX”;
contact.Email1Address = "/o=Exchange-staples/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=desdemonias"; //legacyExchangeDN
contact.Save();

When I click on EmailAddress Field Contact via Outlook, it doesn’t link to GAL Exchange user.

I also try this code but it doesn’t work too.

RDOMail item = folder.Items.Add("IPM.Contact");
RDOContactItem contact = (RDOContactItem)item;
String Email1AddressTypeTmp = contact.Email1AddressType;
String Email1AddressTmp = contact. Email1Address;
String Email1AddressIDTmp= contact.Email1EntryID;

contact.Email1AddressType = Email1AddressTypeTmp;
contact.Email1Address = Email1AddressTmp;
contact.Email1EntryID = Email1AddressIDTmp;
contact.Save();

I think, I need to initialize another properties but I don’t know wich one…


Thank you so much for your help !

Olivier Lemonnier





EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com/default.aspx?ref=ng
 
D

Dmitry Streblechenko

Try to set the EMail1EntryId property - it will update the other 3
properties (address, name, address type)

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
D

Dmitry Streblechenko

Thanks for catching that.
I sent a version of the dll that fixes that issue to your private e-mail
address.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
O

Olivier Lemonnier

Thank you so much Dmitry.
It works fine!

Dmitry Streblechenko said:
Thanks for catching that.
I sent a version of the dll that fixes that issue to your private e-mail
address.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
O

Olivier Lemonnier

If developpers need to get the entryID :

String entryIDUser = session.AddressBook.ResolveName(user, false,
"").EntryID;
//user can be "Login", "firstName" or "lastName".
contact.Email1EntryID = entryIDUser;


If i can suggest a remark,
When i link my contact to Exchange user via Outlook, the format
Email1DisplayName is "FirstName LastName (Email1Address)".

When i link it via Redemption.dll, the format Email1DisplayName is
"FirstName LastName".

Cordialy,

Olivier Lemonnier
 
O

Olivier Lemonnier

Hi Dmitry,

I come back about error in my test environnement Windows Server 2003 64 bits
with Exchange Server 64bits.
When i try to use Redemption.dll in Server 2003 X64, i get this error :

Retrieving the COM class factory for component with CLSID
{29AB7A12-B531-450E-8F7A-EA94C2F3C05F} failed due to the following error:
80040154.

I install Redemption.dll with these command but I still get the error.
%SYSTEMROOT%\SysWOW64\regsvr32.exe "C:\Program Files
(x86)\Redemption\Redemption.dll"

%SYSTEMROOT%\System32\regsvr32.exe "C:\Program Files
(x86)\Redemption\Redemption.dll"

Can you help me, please.

Thank so much.

Olivier Lemonnier
 
D

Dmitry Streblechenko

Make sure your app is compiled as 32 bit only: since MAPI is 32 bit, and
Redemption loads it in-proc, Redemption must also be 32 bit. Which, since
Redemption is an in-proc COM library, requires that the calling app must be
32 bit.

When and if MS releases the 64 bit version of MAPI, there will be a 64 bit
version of Redemption.


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
O

Olivier Lemonnier

Thank you Dmitry.

Yés, the problem was the value of my Platform target "Any CPU".
I changed it to "x86".
Now, I need to change the Application Pool of my IIS Server. (Enable 32 Bits
Application)

I can change it with this command but i don't want to break my Exchange
Server 2007.
"cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true""

Have you ever do it ?

Thank you.

Olivier Lemonnier
 

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