none
HTA Lync Presence RRS feed

  • Question

  • Hi,

    I am trying to create an HTA that allows the Lync Presence to be displayed.

    As a test, I am using the following code:

    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <HTA:APPLICATION
      APPLICATIONNAME="Presence"
      VERSION="2.2"
      BORDER="thin"
      BORDERSTYLE="raised"
      MAXIMIZEBUTTON="no"
      MINIMIZEBUTTON="yes"  
      ICON="ADUtil.ico"
      SCROLL="no"
      SCROLLFLAT="yes"
      SINGLEINSTANCE="yes"
      CONTEXTMENU="no"
      NAVIGABLE="yes"/> 
    
    
    
    <script type="text/javascript">
    
    var sipUri = "enter@sipaddress.here";
    var nameCtrl = new ActiveXObject('Name.NameCtrl');
    if (nameCtrl.PresenceEnabled)
    {
      alert("test");
      nameCtrl.OnStatusChange = onStatusChange;
      nameCtrl.GetStatus(sipUri, "1");
    }
    
    function onStatusChange(name, status, id)
    { 
       alert(name + ", " + status + ", " + id);
    }
    function ShowOOUI()
    {
       //alert(nameCtrl.GetStatus(sipUri, "1")
       nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
    }
    function HideOOUI()
    {
       nameCtrl.HideOOUI();
    }
    </script>
        
    </head>
    <body>
    
    <form id="form1" runat="server">
       <div>
        <span id="test" onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Here is the contact info</span>
       </div>
     </form>
    </body>
    </html>

    This works fine in IE, but when attempting to run it in an HTA I get a "Permission Denied" error whenever I hover over the span.

    Do you have any advice on how to get this to work correctly?

    Regards,

    DMO



    • Edited by DaMentalOne Wednesday, April 20, 2016 1:30 PM
    Wednesday, April 20, 2016 12:23 PM

Answers

  • If that control exists, it happens to be installed on your local computer.

    I can do this in a 32-bit PowerShell console:


    PS C:\> New-Object -ComObject "Name.NameCtrl"
    OnStatusChange         :
    PresenceEnabled        : 0
    OnNoteChange           :
    OnLocationChange       :
    OnPresenceStringChange :
    OnCapabilityChange     :
    OnError                :
    SignedInUser           :
    OnSignedUserChange     :
    

    It is possible to find out information about this object by searching. For example:

    http://www.google.com/search?&q=name.namectrl

    I don't see anywhere in the documentation that this control is supported in an HTA. Presuming it will work in an HTA may just be wishful thinking. As we already know, wishful thinking does not cause features to spring into existence.

    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by DaMentalOne Wednesday, April 20, 2016 2:36 PM
    Wednesday, April 20, 2016 2:21 PM
    Moderator

All replies

  • The control only works in a page opened from the SharePoint server that hosts they Lync server. It is a SharePoint extension control.  It will not work without the server.

    Read this: https://msdn.microsoft.com/en-us/library/office/ms455335%28v=office.14%29.aspx?f=255&MSPPError=-2147217396


    \_(ツ)_/


    • Edited by jrv Wednesday, April 20, 2016 1:08 PM
    Wednesday, April 20, 2016 1:07 PM
  • Hi,

    Thanks for your reply.

    If that is the case, why is it when I create a local html file with the code listed above, it works?

    I have no link to the SharePoint system at all.

    Regards,

    DMO

    Wednesday, April 20, 2016 1:23 PM
  • Hi,

    Thanks for your reply.

    If that is the case, why is it when I create a local html file with the code listed above, it works?

    I have no link to the SharePoint system at all.

    Regards,

    DMO


    It doesn't work it just doesn't display the error.  In HTML you have to trap the error or configure IE to report ALL errors.

    \_(ツ)_/

    Wednesday, April 20, 2016 2:08 PM
  • If that control exists, it happens to be installed on your local computer.

    I can do this in a 32-bit PowerShell console:


    PS C:\> New-Object -ComObject "Name.NameCtrl"
    OnStatusChange         :
    PresenceEnabled        : 0
    OnNoteChange           :
    OnLocationChange       :
    OnPresenceStringChange :
    OnCapabilityChange     :
    OnError                :
    SignedInUser           :
    OnSignedUserChange     :
    

    It is possible to find out information about this object by searching. For example:

    http://www.google.com/search?&q=name.namectrl

    I don't see anywhere in the documentation that this control is supported in an HTA. Presuming it will work in an HTA may just be wishful thinking. As we already know, wishful thinking does not cause features to spring into existence.

    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by DaMentalOne Wednesday, April 20, 2016 2:36 PM
    Wednesday, April 20, 2016 2:21 PM
    Moderator
  • Hi again,

    name.dll is installed as part of MS Office and MS Lync, so yes, it is installed on my machine.

    And as for wishful thinking, that is also true, sadly.

    Thanks for the advice all the same. :)

    Wednesday, April 20, 2016 2:34 PM
  • Correct. The control may exist and even let you create an instance of it, but that doesn't mean it works in the context you want to use it (HTA).

    -- Bill Stewart [Bill_Stewart]

    Wednesday, April 20, 2016 2:35 PM
    Moderator