![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Print a Text file 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??. Any help would be much appreciated. Charles |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Print a Text file There might be a better option than this, but you could try it: IE has an ExecWB method that basically provides access to common menu items. And IE will load a text file as plain text. (You could also, conceivably, use the DOM once the file is loaded to change the font, etc.) If you load the file into an IE instance using IE.Navigate then you should be able to print it using: IE.ExecWB 6, 2 ' -- (print, don't prompt user) Quote: > Hi I have created a text file in vba and I need to print the file without Quote: > user opening it first, I have tried using excel import and print this Quote: > but cuts some of the text off. I was wondering if it can be printed by Quote: > the text file to the printer??. > Any help would be much appreciated. > Charles |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Print a Text file vqthomf wrote: Quote: > 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??. 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/micro...7fb716b968f3ad 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) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Convert hostname text file to IP text file | VB Script | |||
| Looping Through A Text File To Find Patterns From Another Text Fil | PowerShell | |||
| Howto: Add lines of text from a specific point in a text file.. | VB Script | |||
| I cannot print the text that come with the emails | Vista mail | |||
| How do I read a text file and sort text by fixed positions? | PowerShell | |||