Link to home
Start Free TrialLog in
Avatar of ayrezyle
ayrezyle

asked on

Printing a specific frame on request

I want to put a button/link in an asp page that will print the frame it's in (and only that frame) automatically. ANY suggestions welcome, but if the view is changed (another page loaded, etc), I need to be able to return to the current "view" without knowing what it looks like (I don't know what layout the "higher level" frames takes on).

A possible solution is to place a button which feeds keystrokes to the browser after the frame got focus. The keys would be CTRL-P, ALT-R, <ENTER> or some such. But how does one do that?
ASKER CERTIFIED SOLUTION
Avatar of ptruman
ptruman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ayrezyle
ayrezyle

ASKER

That printed the whole set of frames. Each individually. When I moved the JScript call to an <A href= "JScript:tmt_print"> PRINT </A> tag in the relevant frame, it worked beautifully (printing just the focused frame)! Thanks!
Problem: When I click OK in the popup it prints fine, but when I choose "cancel" it pops up the window _again_ and if I then click cancel again, it gives me a script error! How  do I correct this?
Problem: When I click OK in the popup it prints fine, but when I choose "cancel" it pops up the window _again_ and if I then click cancel again, it gives me a script error! How  do I correct this?
The problem is at the following line of code :
WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);