October 2005 - Posts

Using the Messenger API in HTML
Thursday, October 13, 2005 6:44 PM
I was curious if this was possible. A lot of people want to be able to show presence information in web pages, but don't want to have deploy lots of server controls.

Here is an example showing how to show a count of unread email in your inbox:

<object id="objMessenger" classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28" VIEWASTEXT></object>
<script language="jscript">
function updateUnreadEmail()
{
 spanUnreadEmail.innerHTML=objMessenger.UnreadEmailCount(0);
}
</script>
<span id="spanUnreadEmail"></span>
You'll then need to invoke the updateUnreadEmail() function which you could do in the body's onload event.  This is all client side and can be in any web page.  There is no error handling so it only works if you have Messenger running and signed in, but what this shows is what I wanted to find out which is that it is possible.

This information is not in the MSN Messenger developer center.  The way I found it was to download the Office Communicator Presence Controls.  They install a Messenger APIs help file (CHM file).  There they list all of the methods, properties, events, and, the secret codes, the class IDs.
More Posts