none
adds-in of power point 2013 crash when new XMLHttpRequest invoke open in javascript RRS feed

  • Question

  • I new a shared add-in of ppt with VC++/ATL,  put a html in a htmlDialog, so when click a button after open a ppt file, the html dialog will popup, and in the html use javascript new XMLHttpRequest(), the newed object can open url in ppt2007,ppt2010 but, when invoke open in 2013, it will fail. and catch the exepction show "object error"

     if (window.XMLHttpRequest) {
       xmlHttp = new XMLHttpRequest();
       if (xmlHttp != null)           
          alert("xmlhttprequest ok!");
    }
    else if (window.ActiveXObject) 
    {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlHttp != null)           
          alert("Microsoft xmlhttp ok!");
    }

    .....

    .........

    ..............

    xmlHttp.open("GET", url, true);  /////////crash here. object undefined in ppt 2013

    I import ppt with below style in the stdafx.h.

    using namespace ATL;
    #import <C:\Program Files\Common Files\Designer\MSADDNDR.DLL> raw_interfaces_only, raw_native_types, no_namespace, named_guids, auto_search

    #ifdef  ADDIN
    #import <Microsoft Shared\OFFICE11\mso.dll> rename_namespace("Office")
    #else
    #import <C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll> rename_namespace("Office")
    #endif
    using namespace Office;

    #import <C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.olb> rename_namespace("VBE6")
    using namespace VBE6;

    //For coincidence code of svn, about the following #import, we use relative path. 
    //So you need to add setup dir of your office to PATH(environment variable). 
    // setup dir of your office, for example is C:\Program Files\Microsoft Office.
    #ifdef   ADDIN
    #import <Office11\MSPPT.OLB> named_guids,rename_namespace("MSPPT")
    #else
    #import "libid:91493440-5A91-11CF-8700-00AA0060263B" named_guids,rename_namespace("MSPPT")
    Thursday, May 8, 2014 8:22 PM

All replies

  • Hi,

    According to your description, you used ActiveX in the HTML Page, and then the error messaged is showed in the HTML page rather than the Shared Add-in.

    I suspect this issue may be related to the web browser control. So could you run this web page successfully when it is hosted on other independent application (such as console application or a common Win32 application)?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 9, 2014 10:03 AM
    Moderator