Print directly in IE without prompting user

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QmlsbHkgWmhhbmc=?=

    Print directly in IE without prompting user

    I have a asp.net page, it uses js to print in IE.
    It always has the prompting user window appear.

    I have tried:

    <input onclick="docume nt.all.WebBrows er.ExecWB(6,6)" type="button"
    value="Print directly">

    <input onclick="docume nt.all.WebBrows er.ExecWB(6,2)" type="button"
    value="Print directly">

    All didn't work.


    For example:
    以下内容是CSDN社区关于document.all.WebBrowser.ExecWB(6,1) document.all.WebBrowser.ExecWB(6,6) 有什么不同之处&#xff1f;相关内容,如果想了解更多关于.NET社区社区其他内容,请访问CSDN社区。




    OLECMDEXECOPT_D ONTPROMPTUSER = 2,

    How to avoid this prompt window?

    Thanks,
    -Billy



  • Munna

    #2
    Re: Print directly in IE without prompting user

    Hi

    All you can do is to build a separate printer friendly page and onload
    use window.print to popup the print dialog...
    but avoiding the dialog... not sure if possible ...

    regards

    Munna

    Comment

    • Mark Rae [MVP]

      #3
      Re: Print directly in IE without prompting user

      "Munna" <munnaonc@gmail .comwrote in message
      news:be6488ba-d567-487e-90b1-3556a380b5c2@x4 1g2000hsb.googl egroups.com...
      but avoiding the dialog... not sure if possible ...
      Not natively - all modern browsers are designed specifically to prevent this
      sort of direct interfacing with client hardware and software, for fairly
      obvious security reasons...


      --
      Mark Rae
      ASP.NET MVP


      Comment

      • Steven Cheng [MSFT]

        #4
        RE: Print directly in IE without prompting user

        Hi Billy,

        As for printing in web page via client script, it is quite restricted due
        to browser's security model, it won't allow silent print via script.
        Generally, we only have the "window.print() " function to let user
        interactively print the current active document in the browser. For those
        cases that we need more control over the printing in webpage, we may
        consider some rich client approach such as ActiveX control(require the
        client-side to allow running of the activex).

        Sincerely,

        Steven Cheng
        Microsoft MSDN Online Support Lead

        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.

        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Gain technical skills through documentation and training, earn certifications and connect with the community

        ications.
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.

        --------------------
        >From: =?Utf-8?B?QmlsbHkgWmh hbmc=?= <htinns@noemail .noemail>
        >Subject: Print directly in IE without prompting user
        >Date: Tue, 5 Aug 2008 03:07:04 -0700
        >I have a asp.net page, it uses js to print in IE.
        >It always has the prompting user window appear.
        >
        >I have tried:
        >
        ><input onclick="docume nt.all.WebBrows er.ExecWB(6,6)" type="button"
        >value="Print directly">
        >
        ><input onclick="docume nt.all.WebBrows er.ExecWB(6,2)" type="button"
        >value="Print directly">
        >
        >All didn't work.
        >
        >
        >For example:
        >http://topic.csdn.net/t/20060509/01/4737530.html
        >http://blog.chinaunix.net/u1/51862/showart_435050.html
        >http://msdn.microsoft.com/en-us/library/ms683930.aspx
        >
        OLECMDEXECOPT_D ONTPROMPTUSER = 2,
        >
        >How to avoid this prompt window?
        >
        >Thanks,
        >-Billy
        >
        >
        >
        >

        Comment

        Working...