Sign in to follow this  
Followers 0
DarkAngelBGE

Printing dynamic text on a preset sheet

9 posts in this topic

Hi all,

what I want to this print sheets of papers for dynamic names. It's for an election program...basically I add names to a list and then want to print vote sheets for each of the candidates. How can this be done in AutoIt? What I will need to do is print a name say 3cm from the top left corner of the sheet (as the name goes there in the template).

Thanks for any help in advance! :)

Share this post


Link to post
Share on other sites



I was thinking of using IE and CSS to do what I need.

#include <IE.au3>

$file = @scriptdir & "\output.htm"
FileWriteLine($file,"<b>Bold text</b>")

$oIE = _IECreate ($file,0,0)
_IEAction ($oIE, "print")
_IEQuit ($oIE)

However, when I try this code no printer dialog box opens for me. :)

Share this post


Link to post
Share on other sites

Have a search in the helpfile or on the forum for a start !!

_FilePrint ( $s_File [, $i_Show] )

#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.")

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

I saw a reference to a "Word Automation Library", which I assume refers to M$ Word - I haven't looked at it too hard, but it might have some pertinence here.

Now, the question is, does it have any pertinence to Open Office?


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

@Shevilie: Hrm, I guess you did not understand what I was saying. I need formatting...like dynamic text from 3cms of the left top corner of the paper. Simply printing a file is not what I need. :)

@longtex: Got any link for me please?

Share this post


Link to post
Share on other sites

Nvmind, got it to work, thanks. :)

Share this post


Link to post
Share on other sites

@Shevilie: Hrm, I guess you did not understand what I was saying. I need formatting...like dynamic text from 3cms of the left top corner of the paper. Simply printing a file is not what I need. :)

@longtex: Got any link for me please?

Er, uh, I haven't tried setting these cute little internal links, so I'll just tell you where I found it -

Go to Example Scripts and search "word automation library" and it'll be right there for you...


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

Or look in my signature :) You would find a long list there of stuff you can use :D


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Nvmind, got it to work, thanks. :whistle:

DarkAngelBGE You say you got it to work, can you share, might help someone else in the future..

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