Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Second document in print is getting skipped

Status
Not open for further replies.

Pimafix

Technical User
Sep 6, 2006
14
US
I am having a printing problem where the documents get skipped. the code reads:

Sess0.Screen.WaitForString "** DOCUMENT PRINT SELECT **", 1, 24
Sess0.Screen.WaitForString "ID Description", 3, 47

Do While Sess0.Screen.GetString(2, 40, 4) <> PRTR
Sess0.Screen.putstring PRTR, 2, 40
Loop

Do While Sess0.Screen.GetString(2, 14, 4) <> Docset
Sess0.Screen.putstring Docset, 2, 14
Loop

Do While Sess0.Screen.GetString(2, 27, 4) <> WDLT
Sess0.Screen.putstring WDLT, 2, 27
Loop

Do While Sess0.Screen.GetString(2, 53, 1) <> Two
Sess0.Screen.putstring Two, 2, 53
Loop

Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.SendKeys ("<Enter>")

Do While Sess0.Screen.GetString(2, 27, 4) <> CSCR
Sess0.Screen.putstring CSCR, 2, 27
Loop

Do While Sess0.Screen.GetString(2, 53, 1) <> One
Sess0.Screen.putstring One, 2, 53
Loop

Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.WaitForString "** DOCUMENT PRINT SELECT **", 1, 24

But the last document - CSCR - gets skipped. Any ideas on how to solve this or the save as problem in my other post?
 
Not sure why all the loops?
Code:
[s]Do While Sess0.Screen.GetString(2, 40, 4) <> PRTR
    Sess0.Screen.putstring PRTR, 2, 40
Loop[/s]

If Sess0.Screen.GetString(2, 40, 4) <> PRTR then Sess0.Screen.putstring PRTR, 2, 40
'Or even just
Sess0.Screen.putstring PRTR, 2, 40
either should work the same as the code you provided. Where are you setting your CSCR variable?

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.

Very Funny!! :)

Actually the reason I am running loops is because a lot of the time I can't get the putstring to stick with just one line of code. I am taking to doing the same line of code three times because nothing seems to work for getting the putstrings to stick regularly.

The other problem is that the macro goes to fast it won't recognize wait strings so I am running into issues there. I tried doing a wait string so the computer would recognize the new data has been entered before going on but it would simply sit there and stare at me.

Example

Sess0.Screen.putstring Two, 2, 53
Wait for string two, 2,53
Sess0.screen.putstring, DocId







 
Code:
Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.SendKeys ("<Enter>")

MsgBox "Pause"

Do While Sess0.Screen.GetString(2, 27, 4) <> CSCR
    Sess0.Screen.putstring CSCR, 2, 27
Loop

Based on your code I'm going to assume Enter is taking you to the next page/document. It might be possible your PutString is occuring faster than the SendKeys. You can test this by having a MsgBox pause right after the SendKeys. This will give them time to take so that you can determine if that's the problem.
 
Sound like a good idea to me. If the msgbox don't show it ain't working.

By the way, your idea for a counter worked great to solve some of my other problems. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top