Sign in to follow this  
Followers 0
jmiley

Printing script problem

6 posts in this topic

Hello all!

I've greated a gui window to display a webpage using _IECreateEmbedded. Everything works perfectly, except I wanted to have a button to print the information that is inputed into the form. After the information in inputted, I need three copies of the form.

So for my Case $msg = $GUI_Button_PRINT, I've done this:

Send ("^p")

sleep(1000)

Send("!C")

Send("3")

Send("{enter}")

The print dialog comes up perfectly, but that is about it. The Alt+c doesn't seem to be taking. I've tried to adjust the sleep time just in case that was the problem but that isn't helping.

Any suggestions on why this isn't working?

Share this post


Link to post
Share on other sites



What about something like:

For $i = 1 To 3
    _IEAction($oIE, "printdefault")
Next

Share this post


Link to post
Share on other sites

What about something like:

For $i = 1 To 3
    _IEAction($oIE, "printdefault")
Next

Thanks for the prompt reply, GMK. That works perfectly except in my previous post I left out a few steps (for simplicity). I was also having the script perform a few other actions to change the orientation to landscape. I know from reading previous posts here I am unable to do that with "printdefault" :huh2:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Send ("^p")

sleep(1000)

Send("!C")

Send("3")

Send("{enter}")

The print dialog comes up perfectly, but that is about it. The Alt+c doesn't seem to be taking. I've tried to adjust the sleep time just in case that was the problem but that isn't helping.

Any suggestions on why this isn't working?

I think ALT should be "{ALT}C"

Edited by MrMitchell

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You may want to put in WinWaitActive too otherwise if it takes longer than 1sec to open it will miss

Edit: Or WinActivate

Edited by zac23

Share this post


Link to post
Share on other sites

I had tried WinWaitActive and it seemed to pause up my script. I've decided to work more with this and am finding interesting results with the print window.

It seems to be that the send functions after ("^p") are being ran after the Print window is closed. So just for kicks, I made my print function:

Func print()
Send ("^p")
Sleep(5000) ; more than enough time for the dialog to open
WinActivate("Print") ; just to be on the safe side
MsgBox(0,"","Test MsgBox")
EndFunc

Regardless of how long I wait, the message box will not appear until after I close out of the Internet Explorer print dialog. If I put in a Sleep before the msgbox, it will wait that long after closing for it to appear.

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