NSearch Posted September 30, 2005 Share Posted September 30, 2005 Are there any functions which will allow a document to automatically be sent to the default printer, and printed. Thanks. Link to comment Share on other sites More sharing options...
Ghastly_MIB Posted September 30, 2005 Share Posted September 30, 2005 I don't know but if it is a text (TXT) file, you can print it with notepad... The command is: $openfile = Your file to print RunWait(@WindowsDir&"\Notepad.exe /p """& $openfile &"""", "", @SW_HIDE) Link to comment Share on other sites More sharing options...
Josbe Posted September 30, 2005 Share Posted September 30, 2005 I don't know but if it is a text (TXT) file, you can print it with notepad...The command is:$openfile = Your file to print RunWait(@WindowsDir&"\Notepad.exe /p """& $openfile &"""", "", @SW_HIDE)If the file is plain text or PRN file, you can too:$sFile= "yourFile.txt" RunWait(@Comspec & " /c copy " & $sFile & " LPT1 /B",'', @SW_HIDE) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
BigDod Posted September 30, 2005 Share Posted September 30, 2005 If the file is plain text or PRN file, you can too:$sFile= "yourFile.txt" RunWait(@Comspec & " /c copy " & $sFile & " LPT1 /B",'', @SW_HIDE)Will not work with a USB printer Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Josbe Posted September 30, 2005 Share Posted September 30, 2005 (edited) Will not work with a USB printerYes, it's an old method. Edited September 30, 2005 by Josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
HardCopy Posted September 30, 2005 Share Posted September 30, 2005 in the beta version you have available the _FilePrint($file) command HardCopy Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
Xander Posted September 30, 2005 Share Posted September 30, 2005 (edited) I have my computer set up so that if any one on my MSN Messenger list should send me a .doc that it will print.You have to "prepare" MS Word by adding a macro to it.See http://www.12ghosts.com/ghosts/timer_faq.htm for instructionsThe macro only prints a set filename.The script checks every 10 seconds for a received document. If it finds one, it copies it to the Temp dir as the filename recognized by the macro, calls up Winword with the macro, and moves it out of Received so that it's not detected twice.This will print to the default printer. When you right-click a Word doc, you've got a Print option ... I was looking for a way to effect that when a file was found but had to make my own. I'm sure it could be adapted to almost anyone's needs.#notrayicon $Quote = '"' $rec="D:\My Documents\My Received Files\" $MSW=$quote & @ProgramFilesDir & "\Microsoft Office\OFFICE11\WINWORD.EXE" & $quote & " /mPrintNow " While 1 $recd="" FileChangeDir($rec) $search = FileFindFirstFile(@MyDocumentsDir & "\My Received Files\*.doc") If $search <> -1 Then Sleep(10000) While 1 $file = FileFindNextFile($search) If @error Then ExitLoop If FileExists($file) Then FileCopy($file, @TempDir & "\test.doc",1) RunWait($MSW) sleep(10000) FileMove($file, $rec & "Printed\" & $file,1) FileDelete(@TempDir & "\test.doc") EndIf WEnd EndIf Sleep(10000) WEnd Edited September 30, 2005 by Xander Link to comment Share on other sites More sharing options...
B3TA_SCR1PT3R Posted October 1, 2005 Share Posted October 1, 2005 does nobody know wat DOS is??? _RunDOS("print *filename*") that simple no dll calls no quadruple C++ lines of code...a simple 1 liner [right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right] Link to comment Share on other sites More sharing options...
ryeguy Posted October 1, 2005 Share Posted October 1, 2005 ^ this man says it all Link to comment Share on other sites More sharing options...
jefhal Posted October 1, 2005 Share Posted October 1, 2005 I think the original poster "Nsearch" is gone, but you don't want to use the dos print command on a Word doc. I know, I just tried it! DooHH! However, if the doc resides in Word (or any MS app) you could simply send CTRL-P. Or, you could use AntiWord (see parallel thread) to convert the Doc file to text and print that. Too bad Nsearch is gone, or we could ask him what format he wanted to print! ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now