Jump to content
Sign in to follow this  
cppman

Printers

Recommended Posts

cppman

hello people. im back. lol.

Is their any function to print text using the printer?

like actually print it out of the user's default printer?

i've been searching the help file, and all over the forum. can't find anything about it.

i appreciate your help.

Share this post


Link to post
Share on other sites
Valuater

Straight from help

#include <File.au3>

$file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1)
If @error Then Exit

$print = _FilePrint($file)
If $print Then
    MsgBox(0, "Print", "The file was printed.")
Else
    MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.")
EndIf

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
skippynz

hello people. im back. lol.

Is their any function to print text using the printer?

like actually print it out of the user's default printer?

i've been searching the help file, and all over the forum. can't find anything about it.

i appreciate your help.

its in the helpfile beta version

#include <File.au3>

$file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1)
If @error Then Exit

$print = _FilePrint($file)
If $print Then
    MsgBox(0, "Print", "The file was printed.")
Else
    MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.")
EndIf

Share this post


Link to post
Share on other sites
skippynz

Straight from help

#include <File.au3>

$file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1)
If @error Then Exit

$print = _FilePrint($file)
If $print Then
    MsgBox(0, "Print", "The file was printed.")
Else
    MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.")
EndIf

8)

great minds think alike - hahaha

Share this post


Link to post
Share on other sites
cppman

yeah... i tried that earlier but it was'nt "Printing" for me. thanks, and sry to take ur time.

great minds think alike - hahaha

Share this post


Link to post
Share on other sites
skippynz

not working for me either

8)

worked ok for me

Share this post


Link to post
Share on other sites
Rick

is it possible to print an .rft or .doc file to default printer???

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites
skippynz

is it possible to print an .rft or .doc file to default printer???

yep just change the file open dialog to include the doc extn - see code below - you can also add in rtf files too - default app (ie word) opens up file and then prints the selected file then closes again.

#include <File.au3>

$file = FileOpenDialog("Print File", "", "Text Documents (*.txt)|Word Documents (*.doc)", 1)
If @error Then Exit

$print = _FilePrint($file)
If $print Then
    MsgBox(0, "Print", "The file was printed.")
Else
    MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.")
EndIf

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.