Print
Search the Internet "Print selected text", the result is nothing, so try to write a script in this respect.
Print selected text, and include HTML format, but is not perfect, because I did not
Document.stylesheets This set of objects enumerates CSS such as its class,id. To take out its format, this is also to be improved on the one hand. In fact, the copied text pasted into FrontPage and other web editing software can also implement this function, but not the software to install the friends do not worry, you can follow the following methods to achieve. Hope reprint Friend Annotated Source: Weaving Dream Forum (hehe, as for the author who does not matter, piracy does not investigate!)
Implementation method:
Open the registry, open the primary key hkcu\software\microsoft\internet Explorer\menuext, and create a new item: Print the text of the selection area. The default value in the right pane is changed to: D:\script\printSelection.htm.
Then, under D: Disk, create a new folder script, and create a new printselection.htm file in the script folder, which reads:
<script>
var yexj00=external.menuarguments.document;
var sel=external.menuarguments.document.selection.createrange ();
Sel.execcommand ("copy");
if (Yexj00.getelementbyid ("Nooneusethisspecialname") ==null) {
var m=yexj00.createelement ("IFRAME");
M.id= "Nooneusethisspecialname";
void (Yexj00.body.insertAdjacentElement ("BeforeEnd", m));
}
var s=yexj00.frames[' Nooneusethisspecialname '];
S.document.designmode= "on";
Dialog=external.menuarguments.confirm ("Are you sure you want to print the selected text?");
if (dialog) {
S.focus ();
void (S.document.execcommand ("SelectAll"));
void (S.document.execcommand ("Delete"));
void (S.document.execcommand ("Paste"));
void (S.document.execcommand ("Print"));
}
else{alert ("Operation canceled!");
</script>
At this point, you can open a page, select the text and pictures you want to print, right-click the text and pictures you just selected, select the Print Selection Text menu, pop-up the Prompt box, click OK, and start printing.