想使用MSHTML填補通過WebBrowser控件vb.net形式,無法投型「系統.__ ComObject」到接口類型「mshtml.HTMLElementCollection的COM對象
Dim doc As MSH.IHTMLDocument2 = DirectCast(wbMain.Document.DomDocument, MSH.IHTMLDocument2)
Dim buttons As MSH.HTMLElementCollection = doc.getElementsByTagName("button")
Dim Inputs As MSH.HTMLElementCollection = doc.getElementsByTagName("input")
,但我得到出現以下錯誤
Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLElementCollection'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F56B-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
任何人都可以幫我解決可能的解決方案嗎?
謝謝,我感謝你的幫助 – Smith