Wednesday, April 9, 2008

Integrate Microsoft Office Communicator with your Application

While I was using our team room sites which are hosted on share point, I was interested in knowing “How a website shows the status of user which is there in Microsoft Office Communicator?” and my search started to integrate Microsoft Office Communicator with my web application.
So here we have Microsoft Office Communicator installed on user’s machine

Luckily I came to know about NameCtrl Control
A NameCtrl control is an ActiveX control that allows a Web page to display presence information for people, and it allows the user to take various actions with respect to those people through an on-object user interface (UI) in Windows SharePoint Services.
For more details please check out msdn
http://msdn2.microsoft.com/en-us/library/ms455335.aspx
And with small code I could able to come up a HTML page as below,
The code is very simple and easy to use,


HTML Format should be as below
<span>
DISPLAYNAME
<img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('SIPADDRESS')" id='UNIQUE - ID'>
</span>
EXAMPLE:
<span>
Bharat Mane
<img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('bharat.mane@domainname.com')"id='imn7'>
</span>
<span>
Bharat Mane
<img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('E198456@domainname.com')" id='imn7'>
</span>

Note:
Most of the times one's email Id is their SIP Id. But as stated in the above example it might be different also. Good approach would be store and retrieve it from your own database

In the code above there is only one JavaScript function which is new other than basic HTML. This function is responsible to use the ActiveX Name.NameCtrl.1. The complete source code for this function is available in CommunicatorPresence.js.
The complete source code is available at CommunicatorPresence.zip .

In case if you find any information here is wrong please feel free to write to me Bharat.Mane@gmail.com

Thank You
Bharat Mane


7 comments:

Anonymous said...

I downloaded the zip file and edited the html source to show a few of my contacts. However, when the page loads the default icon does not change until I hover the mouse over it. I see that the javascript function is triggered onload. I'm using IE7. Why doesn't the script function?

Anonymous said...

Works great!!! Thanks!!!

Anonymous said...

Very much useful.Thanks a lot...
-Shobha

Anonymous said...

Thanks for the great example.
If have one question reguards the zoom option of IE. If tested it with IE8 and if a zoom level diffrent from 100% the OOUI will be displayed at a wrong position. Does anybody know where this behavoir come from and how to fix it?

scvinodkumar said...

This is really great!!! From where i can download the code??

Anonymous said...

I know this if off topic but I'm looking into starting my own weblog and was curious what all is required to get set up? I'm assuming having a blog like
yours would cost a pretty penny? I'm not very web smart so I'm not
100% sure. Any suggestions or advice would be greatly appreciated. Kudos
My web page :: Credit Repair Reviews

Amycarry said...

listening to the sound: the material is the worst Bathtub faucet resolved, good leader is the whole cast copper, Waterfall faucet . If the sound is very crisp, Faucet parts must be stainless steel, the quality difference would a grade