要有一定的网页知识(HTML、JavaScript、CSS)注意细节:没有"滚动条"和"鼠标右键弹出的 IE 上下文菜单",".HTM 源文件" ...我写了一个,效果还真不错!
'Objects: Form1、Command1、CommonDialog1、WebBrowser1Option ExplicitPrivate Sub Command1_Click()CommonDialog1.ShowOpenIf VBA.Len(VBA.Trim(CommonDialog1.FileName)) > 0 Then Dim p As stdole.StdPicture Dim sPath As String sPath = VBA.Trim(VBA.Trim(CommonDialog1.FileName)) Set p = VB.LoadPicture(sPath) WebBrowser1.Width = p.Width * 16 / 26 WebBrowser1.Height = p.Height * 16 / 26' WebBrowser1.Navigate "about:blank" WebBrowser1.Document.open WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln " WebBrowser1.Document.writeln " WebBrowser1.Document.writeln " WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln "" WebBrowser1.Document.writeln ""End IfEnd SubPrivate Sub Form_Load()Command1.Caption = "&Open"WebBrowser1.Navigate "about:blank"WebBrowser1.Document.openWebBrowser1.Document.writeln ""WebBrowser1.Document.writeln ""WebBrowser1.Document.writeln ""WebBrowser1.Document.writeln ""WebBrowser1.Document.writeln "WebBrowser1.Document.writeln ""WebBrowser1.Document.writeln ""WebBrowser1.Document.CloseEnd Sub