Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Printing web pages


Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2001, 02:45 AM
KBlack
Guest
 
Posts: n/a
Default Printing web pages


I have a list of about 21726 ish URLS and a lot of surveys in a database which I need to print. I have an option of whether to print the web pages or not - if I say no there is no problem and the program runs fine however if I try and get the web pages to print my program crashes with the Dr Watson dialog box. So I can only assume the problem lies with printing the webpages. It never crashes in the same place though and I cant see a reason why it would. Has anyone got any ideas how I could print these. (I dont need to see the pages before they print!).
Reply With Quote
  #2  
Old 12-03-2001, 02:53 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: Printing web pages

what are you using to print the pages IE/WebBrowser Control/DHTMLEdit ?
what code are you using to print the pages ?
Reply With Quote
  #3  
Old 12-03-2001, 02:56 AM
KBlack
Guest
 
Posts: n/a
Default Re: Printing web pages

I am using a webrowser control to print them

I dont know which bits of code to put up here becuase I dont know ehere the problem lies but the actual print command is

WebB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, Empty, Empty
Reply With Quote
  #4  
Old 12-03-2001, 03:07 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: Printing web pages

there is not a problem with the code you have posted, at a guess if you are printing lots of pages then the problem may be that the page is not loaded fully and the webbrowser is still busy, try putting this code just before the above line
<pre><font color=blue>Do</font color=blue>
DoEvents
<font color=blue>Loop Until</font color=blue> Browser.Busy = <font color=blue>False</font color=blue></pre>
Reply With Quote
  #5  
Old 12-03-2001, 03:11 AM
KBlack
Guest
 
Posts: n/a
Default Re: Printing web pages

I have this is the section that hads over the print job

Do Until frmBrowse.WebB.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

frmBrowse.PrintMap


does this not do the same thing?
Reply With Quote
  #6  
Old 12-03-2001, 03:18 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: Printing web pages

yep that should do the same thing,

can you debug your program and tell me where it crashes, otherwise I can only take guesses
Reply With Quote
  #7  
Old 12-03-2001, 03:28 AM
KBlack
Guest
 
Posts: n/a
Default Re: Printing web pages

The problem is that the program does not produce a run-time error but instead crashes vb. Is there a way I can still tell where/how this program occurred?

P.S. Thank-you for your speedy responses it is reall appreciated - K
Reply With Quote
  #8  
Old 12-03-2001, 03:37 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: Printing web pages

are you subclassing in your program?

I can only suggest that you put several on error gotos in your program where you suspect the problem may be and call a message box to display the error number

Reply With Quote
  #9  
Old 12-03-2001, 04:17 AM
KBlack
Guest
 
Posts: n/a
Default Re: Printing web pages

That worked I have fixed the problem it was the section that monitors the print job. I took that section out and it works. All I need to do now is to find out how to pull the names of any print jobs that are in the printer window into vb (without crashing my program) - Any ideas where I can start to look ??
Reply With Quote
  #10  
Old 12-03-2001, 04:27 AM
Ad1 Ad1 is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Feb 2001
Location: UK
Posts: 1,287
Default Re: Printing web pages

The EnumJobs API retrieves information about a specified set of print jobs for a specified printer.

there are details and an example of this in the API Guide
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->