sunnyjassal
Programmer
Hello ..
I am trying to use the web browser object.
what I am trying to do is once the person loads a form it should basically print (without clicking button)the browser object .. but the problem is if i type in the following lines:
brwWebBrowser.Navigate StartingAddress
brwWebBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
back to back
the browser does do what it is suppose to do but does not print, where as if i debug the code and go line by line the print occurs..
i am assuming that the navigator is still trying to download the page therefore printing is not avaible..how can i wait between these 2 lines so i know when to print
i tried putting in
do while brwWebBrowser.Busy
loop
but this takes me in an infinite loop.. if my guess is correct.. I just want to wait in the middle of these lines until the brower is available to print..
i tried putting this code in the documentComplete event
Dim printerBusy As Boolean
printerBusy = True
Do While printerBusy
printerBusy = brwWebBrowser.Busy
Loop
but it did not work..
any help will be appreciated..
Thanks in advance
Sunny Jassal
I am trying to use the web browser object.
what I am trying to do is once the person loads a form it should basically print (without clicking button)the browser object .. but the problem is if i type in the following lines:
brwWebBrowser.Navigate StartingAddress
brwWebBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
back to back
the browser does do what it is suppose to do but does not print, where as if i debug the code and go line by line the print occurs..
i am assuming that the navigator is still trying to download the page therefore printing is not avaible..how can i wait between these 2 lines so i know when to print
i tried putting in
do while brwWebBrowser.Busy
loop
but this takes me in an infinite loop.. if my guess is correct.. I just want to wait in the middle of these lines until the brower is available to print..
i tried putting this code in the documentComplete event
Dim printerBusy As Boolean
printerBusy = True
Do While printerBusy
printerBusy = brwWebBrowser.Busy
Loop
but it did not work..
any help will be appreciated..
Thanks in advance
Sunny Jassal