From: mayayana on 13 Oct 2009 15:10 If it's a flat file, it has no font information, so it will print with the default font in eaither application, IE or Notepad. > Yes, but I was thinking that since it's loaded in a browser window it should be possible to apply styles via the DOM before printing. > Also, are you > sure that IE7 & 8 still supports ExecWB. No. That's why I said *if it works*. I very rarely print anything at all. The ink costs so much, the quailty is not great, and few things need to go onto paper. So I can't imagine a situation where I actually would need to automate printing. > - but it is a pretty big guerrilla to use on a little fly. Yes, indeed. It's kind of embarassing, sometimes... the clunky things we do in scripting to accomplish a goal. :)
From: mr_unreliable on 17 Oct 2009 10:22 vqthomf wrote: > Hi I have created a text file in vba and I need to print the file without the > user opening it first, I have tried using excel import and print this works > but cuts some of the text off. I was wondering if it can be printed by send > the text file to the printer??. hi Vqthomf, If you don't mind using a 3rd Party control, then you can print directly from script without resorting to notepad, IE, or other utility. There is (at least) one, which is simply a wrapper for the vb printer object, written by Lee Peedin, and found here (look for "PrinterObject2.zip" about half-way down the page): http://pragmaticlee.safedataisp.net/ While Lee's actX printer object was written for use with the REXX scripting language, it will work perfectly well with vbscript. Or, if you don't trust Lee, then you can write an actX wrapper for the vb printer object yourself (provided you have a copy of "classic" vb). It is easy to do, so easy that I did it myself. Here is Lee's vbs ng posting about his actX object: http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/bcdf594005eed2ea?q=rexx+printer+object+group:microsoft.public.scripting.vbscript#567fb716b968f3ad Since it is a wrapper for the vb printer object, the documentation is the same as the documentation for the vb printer object itself, (after you get the P.O. instantiated). cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions)
First
|
Prev
|
Pages: 1 2 Prev: Wrong encoding while using WinHttpRequest object ? Next: 85 Opinion Dsiconsolas.com |