Reply to comment

Loading HTML into a WEB Browser Control from Variable

This is sample code. Add error handling and adjust to your requirements as necessary.

lcHtml = [<html><body>Hello World!</body></html>]
lnLoadTimeout = 3       && seconds
WITH Thisform.oWeb.OBJECT
	.Navigate("about:blank")
	* Wait for load completion
	lnStartSeconds = SECONDS()
	DO WHILE .ReadyState <> 4 ;
			AND (SECONDS()-lnStartSeconds <= lnLoadTimeout )
		DOEVENTS
	ENDDO
	* Load HTML into Web Browser Control
	.Document.Open()
	.Document.Write(lcHtml)
	.Document.Close()
	* Wait for load completion
	lnStartSeconds = SECONDS()
	DO WHILE .ReadyState <> 4 ;
			AND (SECONDS()-lnStartSeconds <= lnLoadTimeout )
		DOEVENTS
	ENDDO
ENDWITH

See Also Loading XML into a WEB Browser Control from Variable

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <java>, <powershell>, <tsql>, <visualfoxpro>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.