Print with Internet Explorer right from Opera
Friday, May 18, 2012 8:38:11 PM
Exaggerated? Yes, but not much. Printing is one of weakest points of Opera - at least in Opera for Windows (no *x or M* here, sorry)
A member of the my.opera community asked me, if I could write an extension, that opens the Internet Explorer for printing web pages (yes, the Internet Explorer can indeed print websites) but I had to decline the request for two reasons:
I am not that good in writing extensions and, what is more important, extensions, as they are now, can't do that.
But Opera wouldn't be Opera without the nice hackish solution for (almost) all kinds of problems: Buttons.
... but there is another problem:
The Internet Explorer doesn't support a print command in it's command line, so the button needs some help from a little VBScript file.
Part one of the hack: The Button
The button will not work without the VBS file in the right place!
Print in IE <-click to install the the button and drag and drop it to the toolbar of your liking.
Button code in human readable form:
opera:/button/Execute Program,"iexplore","%u","Print in IE","Print Document"&Delay,2000&Execute Program,"ie_print_preview_v01.vbs"
Part two of the hack: The VBScript
Copy the following, paste it into Notepad or any other text editor of your choice and save it as
in the "Windows" folder of your system. To do this, open the Explorer, type %windir% into the address bar and hit the enter key, or navigate to the windows folder by clicking. The folder is usually called C:\WINDOWS)
' VB Script Document set WshShell = CreateObject("WScript.Shell") WshShell.appactivate "iexplore" WScript.Sleep 100 WshShell.SendKeys "%f" WshShell.appactivate "iexplore" WScript.Sleep 100 WshShell.SendKeys "v"
- "%f" stands for Alt+F (File) in the English version of the Internet Explorer, replace it by "%d" for Alt+D (Datei) in the German version or the appropriate letter that causes the same action in your system's language.
- "v" works for the English and the German version, please change it to the correct letter for your system too.
How it works
Both parts work together by first opening the Internet Explorer with the web page, then waiting for 2s and then sending the keyboard shortcuts for print preview.
If you want to save the VBS with a different name or need to modify the delay because your Internet Explorer starts too slow (someone told me that disabling Flash in IE helps ) you need to modify the button too.
Here the buttOnator link for making your life easier
The "Delay" is in milliseconds, 1000ms = 1s
If you want to save the VBScript to another location or if you want to rename it, you must insert the whole path, e.g.:
(do not change the .vbs file extension)
to Unrealmirakulix for the question and a part of the VBS.