Connecting Tech Pros Worldwide Help | Site Map

VB 6/.NET Code on 2003 Server won't print html file from WebBrowser or axDHTMLEDLib

Newbie
 
Join Date: Apr 2009
Posts: 12
#1: Aug 10 '09
I have code that works fine on my XP machine. It loads an HTML document into the VB 6 WebBrowser control and then uses the following command to print the document without any print dialog box:

mfrmPrint.WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, PRINT_DONTBOTHERUSER_WAITFORCOMPLETION

I have also just implemented a .NET C# DLL that uses the axDHTMLEDLib. It also works fine on my XP computer.

It seems like a simple IE or machine configuration problem. When I open the Internet Explorer 6 browser, the following message is displayed.

Internet Explorer Enhanced Security Configuration is enabled

I have tried removing this (apparently some present IE security settings) and it didn't do the trick.

Thanks for any ideas.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#2: Aug 10 '09

re: VB 6/.NET Code on 2003 Server won't print html file from WebBrowser or axDHTMLEDLib


Does your server have the vbrun6.dll? Is there a benefit to not using the .NET webbrowser control in favor of the vb6 control?
Newbie
 
Join Date: Apr 2009
Posts: 12
#3: Aug 11 '09

re: VB 6/.NET Code on 2003 Server won't print html file from WebBrowser or axDHTMLEDLib


Various VB 6 programs are running fine on the server. I put the code in VB 6 because there seemed to be more examples of working WebBrowser code. I could try doing it in .NET, but I still think the problem isn't the code but some configuration on the Windows 2003 Server...
Newbie
 
Join Date: Apr 2009
Posts: 12
#4: Aug 13 '09

re: VB 6/.NET Code on 2003 Server won't print html file from WebBrowser or axDHTMLEDLib


I get no errors, but nothing is sent to the Printer Queue (I have it paused so I'm sure).

I did disable Enhanced Security, but no change. I have had an issue in the past with this code getting errors and fixed it by reinstalling IE 6 using method 3 in this MS article:

How to reinstall or repair Internet Explorer in Windows Vista and Windows XP

I just discovered that the Server has IE 7 installed and I have IE 6 on my XP machine (It also works on a co-worker's XP with IE 6 machine). I believe the issue is with IE 7 and probably specifically it's security.

I have tried all of the suggestions I could get from this article to no avail (even re-booted after making the registry changes):

Visual Basic 6 And Internet Explorer 7

Added the following to Trusted Sites: IP Address of Printer Port

I think my solution may just be to uninstall IE 7 and install IE 6... :~(
Newbie
 
Join Date: Apr 2009
Posts: 12
#5: Aug 27 '09

re: VB 6/.NET Code on 2003 Server won't print html file from WebBrowser or axDHTMLEDLib


Does it make any difference that the 2003 Server is also a VMware environment?
Reply

Tags
2003, html, print, vb6, webbrowser