Sign in to follow this  
Followers 0
NSearch

Auto Print

10 posts in this topic

Are there any functions which will allow a document to automatically be sent to the default printer, and printed.

Thanks.

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 instructions

The 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 by Xander

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

^ this man says it all

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0