在一个应用程序中,我mshtml.IHTMLElement.getAttribute(mimetype)
用来提取mshtml.HTMLDocument
.
例子:
www.mywebsite.com/index.html。这个网页有 1 个 mimetype,它是一个 Excel 工作簿。
Dim oHTML_Element As mshtml.IHTMLElement
Dim HTMLDoc As mshtml.HTMLDocument
HTMLDoc = CType(oBrowser.Document, mshtml.HTMLDocument)
'//mimtype = "Microsoft Office Excel 97-2003 Worksheet"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("a")
If oHTML_Element.getAttribute("mimetype") is Nothing then
MsgBox ("NONE FOUND")
Else
MsgBox( oHTML_Element.getAttribute("mimetype").ToString())
End If
End For
问题:我正在位置 1(亚太地区)运行此应用程序,当我访问该网页时,我收到一个弹出窗口,MsgBox
显示MIMETYPE
我的同事在位置 2(亚洲)运行此应用程序,当他访问该网页时网页,他会弹出一个MsgBox
显示NONE FOUND
。网页访问不是问题,我们大约在同一时间访问该网页,它是一个静态页面,换句话说,它不是MIMETYPE
基于地理位置服务的。他可以通过手动进入浏览器并单击链接来访问 Excel 工作簿。