locked
Word Task Pane App and Accessing Child Window RRS feed

  • Question

  • I'm trying out a few things with the Task Pane in Word 2013, and what I want to do is open up a child window (sort of a dialog) from the Task Pane (parent) and pass a few form values back from it to the Task Pane (parent). The quick tests I've done seems to indicate that it's not working the way it usually does in "normal" html/browser windows. 

    var childWindow = window.open("dialog.html",..etc...);

    This code opens up the dialog.html window just fine, but the variable "childWindow" is null. Also tried different ways to access the Task Pane dom-tree or elements from the child window using window.opener etc, doesn't seem to work. I guess it may be due to security restrictions in these Office Apps, but is it possible at all to do some kind of "dialog" from Task Pane Apps? There may be an api for it that I haven't found yet (still very new to me).

    Cheers and thanks for any help.


    /Johan

    Saturday, November 16, 2013 12:57 PM

All replies

  • I found a possible reason is

    Opening a new window from an application other than the Internet Explorer process may result in a NULL return value.  This occurs because Internet Explorer runs in protected mode by default. Protected mode prevents applications from privileged access to Internet Explorer when that access spans process boundaries. Because this method opens windows in a new process, protected mode restricts access to the new window. For more information, please see Understanding and Working in Protected Mode Internet Explorer. (refer to open method)

    >>but is it possible at all to do some kind of "dialog" from Task Pane Apps? There may be an api for it that I haven't found yet<<

    Did you mean javarscript API for Office? This API contains objects you can use to write script that interacts with content in Office documents, worksheets, presentations, mail items, and projects from your apps for Office. There is no such API like dialog you want.  You may need to design your app again

    Tuesday, November 19, 2013 5:49 AM