Jump to content
jounipyh

Print variable to default printer

Recommended Posts

jounipyh

hi,

I'm new to AutoIt and would like to know how can i print text from a variable to default printer so that user does not need ack the printing? Test code below. I want to print the $print text that is currently shown on msgbox

Thanks for the help!

 

$cg = "25.4%"
$zfw = "54256 kg"
$cargo = "1025 kg"
$passangers = "109"
$fuel = "1200 kg"
$total = "56456 kg"

$print = "Passangers:" & @TAB & $passangers & @CRLF & "Cargo:" & @TAB & @TAB & $cargo & @CRLF & "ZFW:" & @TAB & @TAB & $zfw & @CRLF & "Fuel:" & @TAB & @TAB & $fuel  & @CRLF & "Total:" & @TAB & @TAB & $total& @CRLF & "CG:" & @TAB & @TAB & $cg

msgbox(1, "Weight info", $print )

Br,

Jouni

Share this post


Link to post
Share on other sites
jounipyh

I tested fileprinting and it works but unfortunately it prints also the filename to first line to paper and I don't want that.

Need to check that UDF how it works, thanks for suggestion!

 

Share this post


Link to post
Share on other sites
jounipyh

Actually it was easy fix for the file print. Just needed to open notepad and remove the header from the layout.

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

×

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.