"Knowledge has to be improved, challenged, and increased constantly, or it vanishes."

Disable the ActiveX warning in Sharepoint 2007 sites

The activeX warning is appearing because Sharepoint is trying to load a control that is used to display presence information in the Sharepoint site. There are two ways of dealing with this, one that is server based and another that is specific to a master page. Use Server Based Solution if you need the solution to apply for all the sites in the server. Apply the Master Page Solution if you want to apply for a particular site/master page.

Why the activeX warning appears

The issue that causes the Name ActiveX Control to run is the function called ProcessImn() that is within the INIT.js file. This call needs to be removed to prevent the browser from trying to load the ActiveX control.

Server Based solution

If all your Sharepoint sites doesn’t require online presence you can apply the below fix. This fix will disable the active warning for all the sites in the server. The steps are as follows.

  • Open the init.js file (Init.js file location \12\Template\Layouts\1033)
  • In the init.js file, locate the following code

 

function ProcessImn()
{
    if (EnsureIMNControl() && IMNControlObj.PresenceEnabled)
    {
        imnElems=document.getElementsByName("imnmark");
        imnElemsCount=imnElems.length;
        ProcessImnMarkers();
     }
}

function ProcessImnMarkers()
{
     for (i=0;i<imnMarkerBatchSize;++i)
     {
        if (imnCount==imnElemsCount)
            return;
        IMNRC(imnElems[imnCount].sip,imnElems[imnCount]);
        imnCount++;
      }
      setTimeout("ProcessImnMarkers()",imnMarkerBatchDelay);
}

  • Comment the above code using /* */
  • Now search for below
          function ProcessDefaultOnLoad(onLoadFunctionNames)

        Inside the function, there is a statement
        ProcessImn();

       Comment this statement. So it will look like
       //ProcessImn();

  • Save the file.

Note: At a very basic only  the step 4(written in green color) is mandatory. Doing it alone will remove the activeX warning. But to be on safe side, do all steps.

Master Page Solution

If your Sharepoint site has both public pages as well as non-public pages(intranet), You should not do the step 1, since for internal users, the online presence information is required. So apply the changes only to a specific master page(s) that is using for public facing websites. The steps are as follows

  • Make a copy of the init.js file to init_noActiveX.js (choose any name as you like)
  • Apply the above steps for Server side fix to the init_noActiveX.js file
  • Open the desired master page in Sharepoint designer
  • In the master page locate the below line of code
    <SharePoint:ScriptLink language="javascript" name="init.js" runat="server"/>

5. Replace the init.js to init_noActiveX.js
Now the above code will look like

<SharePoint:ScriptLink language="javascript" name=" init_noActiveX.js " runat="server"/>

Reference: http://support.microsoft.com/kb/931509

No Comments