Jump to content

Printing script problem


Recommended Posts

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?

Link to comment
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:
Link to comment
Share on other sites

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

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...