Microsoft Knowledge Base Email Alertz

Error message when you call the window.open method from a Web page to open an active document in Internet Explorer: permission denied

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 934365 - Last Review: September 22, 2011 - Revision: 3.0

Error message when you call the window.open method from a Web page to open an active document in Internet Explorer: "permission denied"

On This Page

SYMPTOMS

Consider the following scenario. You call the window.open method from a Web page to open an active document, such as a .doc file, an .xls file, or a .pdf file. You try to access the child window by using a script. In this scenario, you may receive the following error message in Microsoft Internet Explorer 6 or in Windows Internet Explorer 7:
permission denied

CAUSE

When Internet Explorer uses an Active Document server, such as Microsoft Word, Microsoft Excel, or Adobe Reader, to display a document in an Internet Explorer window, the page contains only the active document window and not the MSHTML. Therefore, the window object that is returned by the window.open method is disconnected and is invalidated. Only the IWebBrowser2 browser frame and the active document remain in the new window. Because the methods of the IWebBrowser2 interface are not exposed to scripts, you cannot call the methods of the browser frame by using a script.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
  1. Create a text file that is named Test.html.
  2. Copy and paste the following code into the Test.html file.
    <html>
        <HEAD>
            <SCRIPT language="JavaScript">
          
                    var subWin;
            
                    function openSubView(){
                        
                        subWin = window.open("test.doc");
                    }
    
                    function closeSubView(){
                    if(subWin!=null)
                           {
    			subWin.close();
                            subWin = null;
                           }
    
                    }
    
            </SCRIPT>
        </HEAD>
        <BODY>
           
                    <INPUT type="button" value="Open doc window" onClick="openSubView()" ID="Button1" NAME="Button1">
                     <INPUT type="button" value="Close doc window" onClick="closeSubView()" ID="Button2" NAME="Button2">
            
        </BODY>
    </html> 
    
  3. Create a Word document that is named Test.doc.
  4. Type Hello World in the Test.doc file.
  5. Open Test.html in Internet Explorer 6 or in Internet Explorer 7.
  6. Click Open doc window.

    Notice that the Word document is loaded in the child window.
  7. Click Close doc window to close the child window.

    Notice that you experience the problem that is mentioned in the "Symptoms" section.

APPLIES TO
  • Windows Internet Explorer 9
  • Microsoft Internet Explorer 6.0, when used with:
    • Microsoft Windows Server 2003 Service Pack 1
  • Windows Internet Explorer 7, when used with:
    • Microsoft Windows Server 2003 Service Pack 1
Keywords: 
kbwebbrowser kbtshoot kbinfo kberrmsg kbprb KB934365
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate