+1  A: 
chakrit
What am i going to the definition of. Object? ie.Document? Those bring me to the declaration of Object and IWebDocument2.Document respectivly - not to the declaration of {mshtml.HTMLDocumentClass}.
Ian Boyd
+1  A: 

You can use the Object.GetType() method to obtain information about a particular object you got.

Here's an example:

using System;

static class Program
{
    static void Main()
    {
        var obj = new { Random = "Object" } as object;

        var t = obj.GetType();

        var asm = t.Assembly;

        Console.WriteLine("Type name     : " + t.FullName);
        Console.WriteLine("Namspace      : " + t.Namespace);
        Console.WriteLine("From assembly : " + asm.FullName);
        Console.WriteLine("Located at    : " + asm.Location);

        Console.ReadKey();
    }
}

Or in your case...

var t = ie.Document.GetType()

...should give you type information about what is it that is really inside ie.Document.

chakrit
+2  A: 

A quick search on MSDN gets me to this page which describes how to get the document interface: About MSHTML
Note: I cannot try any of this as I am stuck with VS.80

dragonjujo
Ok, so it was actually Ubiquity - google command, but the first result was a MSDN page.
dragonjujo
Problem with that is it doesn't apply to .NET. There is no IDispatch interface type that you can query for IHTMLDocument2.
Ian Boyd
That's a wholly different usage than it was probably intended then; in that case, good luck
dragonjujo
A: 

Just add a reference to Microsoft.mshtml. 'Nuff said.

Added: OK, a few more words - .NET programs operate with COM objects through these interop assemblies. If you add a reference to a COM object in Visual Studio, VS generates one for you. For the WebBrowser there is already one pre-generated, because it's so often used. But you can't operate with COM "directly". Well, maybe you can, but that would be masohistic.

Vilx-
Problem with that is that now the customer must have Microsoft.mshtml assembly.
Ian Boyd
IMHO .NET installs it along the rest of the framework...
Vilx-
Perhaps, but that doesn't stop the application from crashing when the exact same version of Microsoft.MsHtml PIA is not installed.
Ian Boyd
Then you've missed the point of GAC. It contains many versions of the same DLL, so your application can choose EXACTLY the one it needs. In other words - you can depend on this PIA to be there as much as you can depend on the framework being there.
Vilx-