Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use MSHTML in VB.NET?

Tags:

vb.net

mshtml

In the answer to question #56107, Erlend provided this sample c# code:

using mshtml;
...
object[] oPageText = { html };
HTMLDocument doc = new HTMLDocumentClass();
IHTMLDocument2 doc2 = (IHTMLDocument2)doc;
doc2.write(oPageText);

I'd like to use mshtml in VB.NET, but the IDE doesn't recognize this:

Imports mshtml

What additional steps do I need to take to use MSHTML in VB.NET?

like image 869
Jim Counts Avatar asked Feb 15 '09 07:02

Jim Counts


1 Answers

Found an answer to my own question:

MSHTML in ASP.NET

If you are interested, here is the solution based on VB.NET which you can use with ASP.NET(.aspx.vb). Make sure you add reference to Microsoft.mshtml from the .NET objects collection and "Imports System.Runtime.InteropServices"

With this clue, I found this by opening the "Add Reference" dialog, and looking under the COM tab, not the .NET tab. It's Component Name was Microsoft HTML Object Library.

like image 93
Jim Counts Avatar answered Sep 25 '22 23:09

Jim Counts