Jump to content

Auto Print


NSearch
 Share

Recommended Posts

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)
Link to comment
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


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

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...