Using this (instead of the about: blank document.write command):
myWebBrowser.DocumentText = sourceCode;
seems to solve various problems, such as starting the following JavaScript when IE7 is installed on the system:
window.location = "#test";
If IE 7 is installed, this will result in the message Error: Invalid argument .
source share