jmiley Posted June 9, 2011 Share Posted June 9, 2011 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 More sharing options...
GMK Posted June 9, 2011 Share Posted June 9, 2011 What about something like: For $i = 1 To 3 _IEAction($oIE, "printdefault") Next Link to comment Share on other sites More sharing options...
jmiley Posted June 9, 2011 Author Share Posted June 9, 2011 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" Link to comment Share on other sites More sharing options...
MrMitchell Posted June 9, 2011 Share Posted June 9, 2011 (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 June 9, 2011 by MrMitchell Link to comment Share on other sites More sharing options...
zac23 Posted June 9, 2011 Share Posted June 9, 2011 (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 June 9, 2011 by zac23 Link to comment Share on other sites More sharing options...
jmiley Posted June 10, 2011 Author Share Posted June 10, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now