Reputation: 39
I added to the top of the form
using mshtml;
IHTMLDocument2 doc = (IHTMLDocument2)webbrowser1.Document.DomDocument;
IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)doc.body).createControlRange();
The error is on:
(IHTMLControlRange)((HTMLBody)doc.body).createControlRange();
Error 3 One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?
Upvotes: 2
Views: 515
Reputation: 6251
You need to add a reference to the Microsoft.mshtml
assembly. Follow these steps to do so:
Microsoft.mshtml
is checked.Now everything should work fine.
You may see more than one entry for Microsoft.mshtml
in the listed assemblies. In that case select any one of them (preferably the newest version).
Upvotes: 1
Reputation: 77876
Do remember that just by adding the statement Using mshtml;
(considering that all the types used falls under mshtml
dll) will not bring in the referenced dll. You will also need to add the reference of the dll to your project Reference
folder.
Make sure you have done that.
Upvotes: 2