Westin's Technical Log

  • Using the Messenger API in HTML

    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.

  • Intelligent Hardware Modularity: An Overview

    What is Intelligent Modularity?

    Consumer electronics that are intelligently modular allow the user to use all or some of the devices in concert quickly and easily.

    Principles

    The following principles indicate the attributes of a ecosystem of devices that are intelligently modular.
    Minimalist Connection Hardware
    Each device should strive to connect to its partner devices without any additional hardware (e.g. cables, adapters,, etc). Direct connections or wireless connections are best.
    Transitive Connections
    Devices should be able to link in serial. For instance if a headset can connect to a phone, and a phone can connect to a computer, then connecting the phone to the computer should also connect that phone to the headset.
    Transitive Power
    Powering any one device should power all other hard-connected devices.
    Rugged Connections
    If any collection of devices are physically connected to each other they should be done in such a way that it is possible to carry them as a single unit.  Exposed edges should be avoided in order to prevent the possibility of shearing off a partner device when the collective brushes against an object.
    Adaptable Interfaces
    The physical connection designs should allow for future devices to use them. Ideally this should also mean that other devices and other vendors can take advantage of the physical interfaces. For instance, if a laptop has physical slot for a mobile phone, that slot should be designed in an intelligent way such that other phones or in, in the future, WLAN receivers could be used rather than the recommended mobile phone.

  • Launch an InfoPath form from a SharePoint page

    Here is a handy piece of sample code that can be used within a SharePoint web page as JScript that will launch an InfoPath form without using the Open/Save dialog (which sometimes causes users to download the XSN file onto their computer).  Users will still get a security prompt, which you can disable with policy if this is for intranet usage.

    function LaunchInfoPath(templateURL,saveLocation)
    {
    //savelocation sample: "http://server/site/document library/" or "file://c:"
    //templateURL sample: "http://server/site/form library/forms/template.xsn"
    //The function teturns true if it worked, false if it didn't


    var infopath = new ActiveXObject("SharePoint.OpenXMLDocuments.1");
    var result= infopath.CreateNewDocument2(window, templateURL,saveLocation);
    return result;
    }