You can use both in the same project. You just need to be careful about which namespace you are using. Since System.Windows.Forms.HtmlDocument
and mshtml.HtmlDocument
both share the same class name, you need to make sure you are using the correct one by specifying the right namespace.
Here's how you'd get the two objects from the same WebBrowser
:
Dim unmanagedDoc As mshtml.HtmlDocument = DirectCast(WebBrowser1.Document.DomDocument, mshtml.HTMLDocument)
Dim managedDoc As System.Windows.Forms.HtmlDocument = WebBrowser1.Document