随便在那里加入<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>
然后随便在那个事件中执行
document.all.WebBrowser.ExecWB(6,6)
就是实现不弹出对话框打印
当然6,6还可以换成其他参数,来实现预览等功能

解决方案 »

  1.   

    保存为.htm<STYLE TYPE="text/css">
    PRE.clsCode { font-size:110%; } 
    PRE.clsSyntax { font-size:100%; }  
    TD DIV.clsBeta { display:none;}
    </STYLE><P>WebBrowser Object</P>
    <p>Adds browsing capabilities to your applications.</p>
    <p>Res</p>
    <p>Applications hosting this Microsoft? ActiveX? control will support browsing 
      sites on the World Wide Web, as well as directories on the local computer and 
      on network servers. <br>
    </p>
    <BLOCKQUOTE style="width:95%">
    <DIV tabName="Events" style="visibility:visible"><TABLE CLASS="clsStd" width="100%" STYLE="BACKGROUND: #FFFFFF"><TR><TH>Event</TH><TH>Description</TH></TR><TR><TD><A HREF="../Events/BeforeNavigate2.htm">BeforeNavigate2</A></TD><TD>
    Fires before a navigation occurs in the given <span replace="1">object</span> (on either a window or frameset element).</TD></TR><TR><TD><A HREF="../events/clienttohostwindow.htm">ClientToHostWindow</A></TD><TD>
    Fires to request that the client window size be converted to the host window size.</TD></TR><TR><TD><A HREF="../Events/CommandStateChange.htm">CommandStateChange</A></TD><TD>
    Fires when the enabled state of a command changes.</TD></TR><TR><TD><A HREF="../Events/DocumentComplete.htm">DocumentComplete</A></TD><TD>
    Fires when a document has been completely loaded and initialized.</TD></TR><TR><TD><A HREF="../Events/DownloadBegin.htm">DownloadBegin</A></TD><TD>
    Fires when a navigation operation is beginning.</TD></TR><TR><TD><A HREF="../Events/DownloadComplete.htm">DownloadComplete</A></TD><TD>
    Fires when a navigation operation finishes, is halted, or fails.</TD></TR><TR><TD><A HREF="../Events/filedownload.htm">FileDownload</A></TD><TD>
    Fires to indicate that a file download is about to occur. If a file download dialog is to be displayed, this event is fired prior to the display of the dialog.</TD></TR><TR><TD><A HREF="../Events/NavigateComplete2.htm">NavigateComplete2</A></TD><TD>
    Fires after a navigation to a link is completed on either a <A HREF="../../../../author/dhtml/reference/objects/obj_window.htm">window</A> or <A HREF="../../../../author/dhtml/reference/objects/FRAMESET.htm">frameSet</A> element.</TD></TR><TR><TD><A HREF="../Events/navigateerror.htm">NavigateError</A></TD><TD>
    Fires when an error occurs during navigation.</TD></TR><TR><TD><A HREF="../Events/NewWindow2.htm">NewWindow2</A></TD><TD>
    Fires when a new window is to be created.</TD></TR><TR><TD><A HREF="../Events/ProgressChange.htm">ProgressChange</A></TD><TD>
    Fires when the progress of a download operation is updated on the <span replace="1">object</span>. </TD></TR><TR><TD><A HREF="../Events/StatusTextChange.htm">StatusTextChange</A></TD><TD>
    Fires when the status bar text of the <span replace="1">object</span> has changed.</TD></TR><TR><TD><A HREF="../Events/TitleChange.htm">TitleChange</A></TD><TD>
    Fires when the title of a document in the <span replace="1">object</span> becomes available or changes.</TD></TR><TR><TD><A HREF="../Events/WindowClosing.htm">WindowClosing</A></TD><TD>
    Fires when the window of the <span replace="1">object</span> is about to be closed by script.</TD></TR><TR><TD><A HREF="../events/windowsetheight.htm">WindowSetHeight</A></TD><TD>
    Fires when the <span replace="1">object</span> changes its height.</TD></TR><TR><TD><A HREF="../events/windowsetleft.htm">WindowSetLeft</A></TD><TD>
    Fires when the <span replace="1">object</span> changes its left position.</TD></TR><TR><TD><A HREF="../events/windowsetresizable.htm">WindowSetResizable</A></TD><TD>
    Fires to indicate whether the host window should allow or disallow resizing of the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../events/windowsettop.htm">WindowSetTop</A></TD><TD>
    Fires when the <span replace="1">object</span> changes its top position.</TD></TR><TR><TD><A HREF="../events/windowsetwidth.htm">WindowSetWidth</A></TD><TD>
    Fires when the <span replace="1">object</span> changes its width.</TD></TR></TABLE></DIV><P CLASS="clsRef" STYLE="display:none">Methods</P><DIV tabName="Methods" style="visibility:visible"><TABLE CLASS="clsStd" width="100%" STYLE="BACKGROUND: #FFFFFF"><TR><TH>Method</TH><TH>Description</TH></TR><TR><TD><A HREF="../Methods/ExecWB.htm">ExecWB</A></TD><TD>
    Executes a command on an OLE object and returns the status of the command execution using the <A ALINK="_ole_iolecommandtarget" ALINKPROXY="_ole_iolecommandtarget" HREF="JavaScript:_ole_iolecommandtarget.Click()">IOleCommandTarget</A> interface.</TD></TR><TR><TD><A HREF="../Methods/GetProperty.htm">GetProperty</A></TD><TD>
    Retrieves the value of a property associated with the given object.</TD></TR><TR><TD><A HREF="../Methods/GoBack.htm">GoBack</A></TD><TD>
    Navigates backward one item in the history list.</TD></TR><TR><TD><A HREF="../Methods/GoForward.htm">GoForward</A></TD><TD>
    Navigates forward one item in the history list.</TD></TR><TR><TD><A HREF="../Methods/GoHome.htm">GoHome</A></TD><TD>
    Navigates to the current home or start page.</TD></TR><TR><TD><A HREF="../Methods/GoSearch.htm">GoSearch</A></TD><TD>
    Navigates to the current search page.</TD></TR><TR><TD><A HREF="../Methods/Navigate.htm">Navigate</A></TD><TD>
    Navigates to a resource identified by a URL or to the file identified by a full path.</TD></TR><TR><TD><A HREF="../Methods/Navigate2.htm">Navigate2</A></TD><TD>
    Navigates the browser to a location that might not be able to be expressed as a URL, such as a pointer to an item identifier list (PIDL) for an entity in the Microsoft?Windows?shell namespace.</TD></TR><TR><TD><A HREF="../Methods/PutProperty.htm">PutProperty</A></TD><TD>
    Sets the value of a property associated with the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Methods/Refresh.htm">Refresh</A></TD><TD>
    Reloads the file that is currently displayed in the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Methods/Refresh2.htm">Refresh2</A></TD><TD>
    Reloads the file that is currently displayed in the <span replace="1">object</span>. Unlike <A HREF="../Methods/Refresh.htm">Refresh</A>, this method contains a parameter that specifies the refresh level.</TD></TR><TR><TD><A HREF="../Methods/Stop.htm">Stop</A></TD><TD>
    Cancels any pending navigation or download operation and stops any dynamic page elements, such as background sounds and animations.</TD></TR></TABLE></DIV><P CLASS="clsRef" STYLE="display:none">Properties</P><DIV tabName="Properties" style="visibility:visible"><TABLE CLASS="clsStd" width="100%" STYLE="BACKGROUND: #FFFFFF"><TR><TH>Property</TH><TH>Description</TH></TR><TR><TD><A HREF="../Properties/Application.htm">Application</A></TD><TD>
    Retrieves the automation object for an application that is hosting the <A HREF="../../wbentry.htm">WebBrowser Control</A>.</TD></TR><TR><TD><A HREF="../Properties/Busy.htm">Busy</A></TD><TD>
    Retrieves a <b>Boolean</b> value indicating whether the <span replace="1">object</span> is engaged in a navigation or downloading operation.</TD></TR><TR><TD><A HREF="../Properties/Container.htm">Container</A></TD><TD>
    Retrieves an object reference to a container.</TD></TR><TR><TD><A HREF="../Properties/Document.htm">Document</A></TD><TD>
    Retrieves the automation object of the active document, if any.</TD></TR><TR><TD><A HREF="../Properties/Height.htm">Height</A></TD><TD>
    Sets or retrieves the height of the Microsoft?Internet Explorer main window.</TD></TR><TR><TD><A HREF="../Properties/Left.htm">Left</A></TD><TD>
    Sets or retrieves the screen coordinate of the left edge of the main window of the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Properties/LocationName.htm">LocationName</A></TD><TD>
    Retrieves the name of the resource that Internet Explorer is currently displaying.</TD></TR><TR><TD><A HREF="../Properties/LocationURL.htm">LocationURL</A></TD><TD>
    Retrieves the URL of the resource that Internet Explorer is currently displaying.</TD></TR><TR><TD><A HREF="../Properties/Offline.htm">Offline</A></TD><TD>
    Sets or retrieves a <b>Boolean</b> value that indicates whether the <span replace="1">object</span> is currently operating in offline mode. </TD></TR><TR><TD><A HREF="../Properties/Parent.htm">Parent</A></TD><TD>
    Retrieves the parent of the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Properties/ReadyState.htm">ReadyState</A></TD><TD>
    Retrieves the ready state of the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Properties/RegisterAsBrowser.htm">RegisterAsBrowser</A></TD><TD>
    Sets or retrieves a value that indicates whether the <span replace="1">object</span> is registered as a top-level browser for target name resolution.</TD></TR><TR><TD><A HREF="../Properties/RegisterAsDropTarget.htm">RegisterAsDropTarget</A></TD><TD>
    Sets or retrieves a value that indicates whether the <span replace="1">object</span> is registered as a drop target for navigation.</TD></TR><TR><TD><A HREF="../Properties/Silent.htm">Silent</A></TD><TD>
    Sets or retrieves a value that indicates whether the <span replace="1">object</span> can show dialog boxes.</TD></TR><TR><TD><A HREF="../Properties/Top.htm">Top</A></TD><TD>
    Sets or retrieves the screen coordinate of the top edge of the main window of the <span replace="1">object</span>.</TD></TR><TR><TD><A HREF="../Properties/TopLevelContainer.htm">TopLevelContainer</A></TD><TD>
    Retrieves a value that indicates whether the <span replace="1">object</span> is a top-level container.</TD></TR><TR><TD><A HREF="../Properties/Type.htm">Type</A></TD><TD>
    Retrieves the type name of the contained document object梩hat is, Windows HTML Viewer.</TD></TR><TR><TD><A HREF="../Properties/Visible.htm">Visible</A></TD><TD>
    Sets or retrieves a value that indicates whether the <span replace="1">object</span> is visible or hidden.</TD></TR><TR><TD><A HREF="../Properties/Width.htm">Width</A></TD><TD>
    Sets or retrieves the width of the main window for the <span replace="1">object</span>.</TD></TR></TABLE></DIV>
      </BLOCKQUOTE></BODY></HTML>