'参考学习来源:WEBBROWSER控件去边框 http://bbs.csdn.net/topics/310013215Private Sub Form_Load()
WebHtml WebBrowser1, "<a href='http://www.163.com' target='_blank'>网易首页</a>", True
End Sub
'┏〓〓〓〓〓〓〓〓〓 WebHtml,start 〓〓〓〓〓〓〓〓〓┓
'[简介]:
'把字符串显示在网页上,不保存到文件的方式
Sub WebHtml(Web1 As WebBrowser, html As String, Optional NoScroll As Boolean, Optional WaitMax As Long = 20000)
   '[mycode_id:1336],edittime:2012/3/20 23:46:08
    '  On Error Resume Next
      Web1.Silent = True
      Web1.Navigate "about:blank"
      DoEvents
      Web1.Document.open
      Web1.Document.write html
      DoEvents
      Web1.Stop
      Web1.Document.Close
      If NoScroll Then Web1.Document.body.Scroll = "No"
      Web1.Document.body.Style.border = "0px"
      Web1.Document.body.Style.overflow = "hidden"
      'Web1.Document.body.Style.margain = "0px"
      'Web1.Document.body.Style.padding = "0px"
End Sub
'┗〓〓〓〓〓〓〓〓〓  WebHtml,end  〓〓〓〓〓〓〓〓〓┛

解决方案 »

  1.   

    '参考学习来源:WEBBROWSER控件去边框 http://bbs.csdn.net/topics/310013215Private Sub Form_Load()
    WebHtml WebBrowser1, "<a href='http://www.163.com' target='_blank'>网易首页</a>", True
    End Sub
    '┏〓〓〓〓〓〓〓〓〓 WebHtml,start 〓〓〓〓〓〓〓〓〓┓
    '[简介]:
    '把字符串显示在网页上,不保存到文件的方式
    Sub WebHtml(Web1 As WebBrowser, html As String, Optional NoScroll As Boolean, Optional WaitMax As Long = 20000)
       '[mycode_id:1336],edittime:2012/3/20 23:46:08
        '  On Error Resume Next
          Web1.Silent = True
          Web1.Navigate "about:blank"
          DoEvents
          Web1.Document.open
          Web1.Document.write html
          DoEvents
          Web1.Stop
          Web1.Document.Close
          If NoScroll Then Web1.Document.body.Scroll = "No"
          Web1.Document.body.Style.border = "0px"
          Web1.Document.body.Style.overflow = "hidden"
          'Web1.Document.body.Style.margain = "0px"
          'Web1.Document.body.Style.padding = "0px"
    End Sub
    '┗〓〓〓〓〓〓〓〓〓  WebHtml,end  〓〓〓〓〓〓〓〓〓┛
      

  2.   

    目测是 ShellExecute 函数被杀了,可以使用其他的函数进行操作,比如要打开一个网页的话,可以使用 Shell 函数, Shell "cmd.exe /c http://www.baidu.com",vbhide 这样的话也可以打开网页.