Web| techniques several ways to write HTML content to a WebBrowser
First, add in the Form_Load
WebBrowser1.Navigate "About:blank"
Make sure Webbrowser1 is available
Method 1:
Dim S as String
Dim Stream as IStream
s = ""
s = s + ""
s = s + ""
s = s + "
Hello World
"
s = s + ""
s = s + "
WebBrowser1.Document.Write s
Method 2:
Dim o
Set o = WebBrowser1.Document.selection.createrange
Debug.Print O
If (not o to Nothing) Then
o.pastehtml "haha"
Set o = Nothing
End If
Method 3:
' Insert text box
Dim o
Set o = WebBrowser1.Document.selection.createrange
O.execcommand "Inserttextarea", False, "xxx"
Method 3 uses the method of invoking ExecCommand and passing control commands, which can also be used to insert page elements such as pictures, which can refer to the MSDN execcommand command.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.