With WebBrowser1.Document
.write "<body"
.write "<P>Hello</P>"
.write "</body>"End WithOR:
Dim s As String
s = "<body><P>Hello</P>"
s = s & "</body>"WebBrowser1.Document.body.innerHTML = s

解决方案 »

  1.   

    Dim Doc As Object
        Set Doc = WebBrowser1.Document
        With Doc
            .open
            .writeln "<HTML>"
            .writeln "<HEAD>"
            .writeln "<TITLE>"
            .writeln "New Document"
            .writeln "</TITLE>"
            .writeln "</HEAD>"
            .writeln "<BODY scroll=" & VBA.Chr(34) & "no" & VBA.Chr(34) & " oncontextmenu=self.event.returnValue=false>"
            .writeln "<a href=http://www.csdn.net/>www.csdn.net</a><br><br>"
            .writeln "<a href=http://www.vbgood.com/>www.vbgood.com</a>"
            .writeln "</BODY>"
            .writeln "</HTML>"
            .Close
        End With