472,374 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Want to use msHTML.HTMLDocumentClass

Hi,
I just stepped into C#. I am facing one problem. Here is the scenario. I am
posting some data to one website (https site). It returns me response HTML.
I want to parse this HTML and want to look for some specific tags. To
achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I
dont know how to use it in C#.
I am using .NET framework 1.1.
For posting the data, I am using XMLHTTP class.

Any help is highly appreciated.

Thanks
Atul
Nov 15 '05 #1
10 44243
Dnia 2003-11-13 12:53, Użytkownik Atul napisał:
Hi,
I just stepped into C#. I am facing one problem. Here is the scenario. I am
posting some data to one website (https site). It returns me response HTML.
I want to parse this HTML and want to look for some specific tags. To
achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I
dont know how to use it in C#.
I am using .NET framework 1.1.
For posting the data, I am using XMLHTTP class.

Any help is highly appreciated.

Thanks
Atul

Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S

Nov 15 '05 #2
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable.
The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to
parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can"
use MSHTML.dll to parse the HTML document using htmlDocument object. But how
to load the strResponseHTML into HTMLDocument object, that I want to know.
If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Smółka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Dnia 2003-11-13 12:53, Użytkownik Atul napisał:
Hi,
I just stepped into C#. I am facing one problem. Here is the scenario. I am posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to look for some specific tags. To
achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I
dont know how to use it in C#.
I am using .NET framework 1.1.
For posting the data, I am using XMLHTTP class.

Any help is highly appreciated.

Thanks
Atul

Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S

Nov 15 '05 #3
Atul,

In order to do this, you will have to use one of the IPersist interfaces
that HTMLDocument implements. You can use the IPersistFile interface,
saving your string to a file and then loading it that way, or you could use
the IPersistMemory interface, placing your string into unmanaged memory and
then passing the pointer to that string in memory.

However, if you have relative URLs in this document which you need to
have resolved correctly, then this will not work. The reason is that the
class doesn't know about where the document came from, and can not resolve
these accordingly. In this case, you will have to create an implementation
of IMoniker (which is represented in the System.Runtime.InteropServices
namespace with a name of UCOMIMoniker).

When you create this implementation, you have to implement the
BindToStorage method so that it will return an IStream implementation (the
COM interface) which is asked for eventually. This IStream will stream the
string that you had back to MSHTML.

Also, you will want to implement the GetDisplayName method of the
UCOMIMoniker interface so that it returns the url that this string was
downloaded from.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Atul" <py*****@hotmail.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable. The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can" use MSHTML.dll to parse the HTML document using htmlDocument object. But how to load the strResponseHTML into HTMLDocument object, that I want to know.
If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Smółka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Dnia 2003-11-13 12:53, Użytkownik Atul napisał:
Hi,
I just stepped into C#. I am facing one problem. Here is the scenario. I
am
posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to look for some specific tags. To
achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface.

I dont know how to use it in C#.
I am using .NET framework 1.1.
For posting the data, I am using XMLHTTP class.

Any help is highly appreciated.

Thanks
Atul

Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S


Nov 15 '05 #4
Hi Atul,
I'm using this:

object[] oPageText = {sWebPage};
myDoc = new HTMLDocumentClass();
IHTMLDocument2 oMyDoc = (IHTMLDocument2)myDoc;
oMyDoc.write(oPageText);

This works fine. Of course you have to put this in try/catch block in
order the page is not well formated.

Hope that helps
Sunny
In article <uA**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com
says...
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable.
The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to
parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can"
use MSHTML.dll to parse the HTML document using htmlDocument object. But how
to load the strResponseHTML into HTMLDocument object, that I want to know.
If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Sm??ka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Dnia 2003-11-13 12:53, U?ytkownik Atul napisa?:
Hi,
I just stepped into C#. I am facing one problem. Here is the scenario. I am posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to look for some specific tags. To
achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I
dont know how to use it in C#.
I am using .NET framework 1.1.
For posting the data, I am using XMLHTTP class.

Any help is highly appreciated.

Thanks
Atul

Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S


Nov 15 '05 #5
it might be helpful to preparse the file to remove scripting as mentioned in
the following link
http://216.239.39.104/search?q=cache...hl=en&ie=UTF-8

I know it has helped me a great deal.
"Sunny" <su******@icebergwireless.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Atul,
I'm using this:

object[] oPageText = {sWebPage};
myDoc = new HTMLDocumentClass();
IHTMLDocument2 oMyDoc = (IHTMLDocument2)myDoc;
oMyDoc.write(oPageText);

This works fine. Of course you have to put this in try/catch block in
order the page is not well formated.

Hope that helps
Sunny
In article <uA**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com
says...
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable. The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can" use MSHTML.dll to parse the HTML document using htmlDocument object. But how to load the strResponseHTML into HTMLDocument object, that I want to know. If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Sm??ka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Dnia 2003-11-13 12:53, U?ytkownik Atul napisa?:

> Hi,
> I just stepped into C#. I am facing one problem. Here is the scenario. I
am
> posting some data to one website (https site). It returns me
response HTML.
> I want to parse this HTML and want to look for some specific tags.

To > achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I > dont know how to use it in C#.
> I am using .NET framework 1.1.
> For posting the data, I am using XMLHTTP class.
>
> Any help is highly appreciated.
>
> Thanks
> Atul
>
>
Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S


Nov 15 '05 #6
Hi Hasani,
Thanks for the link.
Btw, do IHTMLDocument2.write(object[]) is executing the scripts?
I do not display the document, just load it.

It will be very helpful if you paste any link where I can read more
about it.

Thanks
Sunny

In article <sD*********************@twister.nyc.rr.com>, HJB417
@hotmail.c0m says...
it might be helpful to preparse the file to remove scripting as mentioned in
the following link
http://216.239.39.104/search?q=cache...hl=en&ie=UTF-8

I know it has helped me a great deal.
"Sunny" <su******@icebergwireless.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Atul,
I'm using this:

object[] oPageText = {sWebPage};
myDoc = new HTMLDocumentClass();
IHTMLDocument2 oMyDoc = (IHTMLDocument2)myDoc;
oMyDoc.write(oPageText);

This works fine. Of course you have to put this in try/catch block in
order the page is not well formated.

Hope that helps
Sunny
In article <uA**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com
says...
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable. The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can" use MSHTML.dll to parse the HTML document using htmlDocument object. But how to load the strResponseHTML into HTMLDocument object, that I want to know. If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Sm??ka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
> Dnia 2003-11-13 12:53, U?ytkownik Atul napisa?:
>
> > Hi,
> > I just stepped into C#. I am facing one problem. Here is the scenario. I am
> > posting some data to one website (https site). It returns me response HTML.
> > I want to parse this HTML and want to look for some specific tags. To > > achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I > > dont know how to use it in C#.
> > I am using .NET framework 1.1.
> > For posting the data, I am using XMLHTTP class.
> >
> > Any help is highly appreciated.
> >
> > Thanks
> > Atul
> >
> >
> Hi,
>
> First you should add refernece to your project - Microsoft.mshtml,
> then by namespace "mshtml" you will have access HTMLDocumentClass
>
> M.S
>


Nov 15 '05 #7
http://support.microsoft.com/default...NoWebContent=1

I was trying to do it as microsoft told me, but the solution @ vbcity was
the quickest and simplest to implement. Microsoft's solution will probably
have the page loaded and parsed faster though.

Also, there's a property of one of the HTMLElement classes called 'all' and
it will return all HTML elements contained inside the invoked HTMLElement

I use the IPersistFile 'method' to load the html code. I had problems when
using HTMLDocument.write.
http://groups.google.com/groups?hl=e...40cpmsftngxa08

and the code I use the load the documents pretty much looks like this

htmlDoc = new HTMLDocumentClass();

System.Runtime.InteropServices.UCOMIPersistFile pf =
(System.Runtime.InteropServices.UCOMIPersistFile)h tmlDoc;

pf.Load(htmlFilename, 0);

while(htmlDoc.body == null)

System.Windows.Forms.Application.DoEvents();

"Sunny" <su******@icebergwireless.com> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
Hi Hasani,
Thanks for the link.
Btw, do IHTMLDocument2.write(object[]) is executing the scripts?
I do not display the document, just load it.

It will be very helpful if you paste any link where I can read more
about it.

Thanks
Sunny

In article <sD*********************@twister.nyc.rr.com>, HJB417
@hotmail.c0m says...
it might be helpful to preparse the file to remove scripting as mentioned in the following link
http://216.239.39.104/search?q=cache...hl=en&ie=UTF-8
I know it has helped me a great deal.
"Sunny" <su******@icebergwireless.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Atul,
I'm using this:

object[] oPageText = {sWebPage};
myDoc = new HTMLDocumentClass();
IHTMLDocument2 oMyDoc = (IHTMLDocument2)myDoc;
oMyDoc.write(oPageText);

This works fine. Of course you have to put this in try/catch block in
order the page is not well formated.

Hope that helps
Sunny
In article <uA**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com says...
> Hi,
> I did the way you just told. Let me clear about the problem.
> I am having one HTML text stored in a string say "strResponseHTML"

variable.
> The code which I am trying to use is as follows:
>
> private void button1_Click(object sender, System.EventArgs e)
> {
> HTMLDocument htmlDoc = new HTMLDocumentClass();
> IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
> try
> {
> string strResponse = getHtml();
> htmlDoc.write(strResponse);
> if (null != htmlDoc)
> {
> MessageBox.Show(htmlDoc.all.length.ToString());
> }
> richTextBox1.Text= htmlDoc.toString();
> }
> catch(Exception ex)
> {
> MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
> }
> }
>
> Now upon seeing the code, what actually I am trying to do is that I want
to
> parse the response HTML to look for some objects with the values.
Those > values I would like to compare.
> We use MSXML2.dll to parse the XML document using XMLDOM, similary

we "can"
> use MSHTML.dll to parse the HTML document using htmlDocument object.
But how
> to load the strResponseHTML into HTMLDocument object, that I want to

know.
> If any body could help me out, highly appreaciated.
> Thanks
> Atul
>
> "Marcin Sm??ka" <ze***@eti.pg.gda.pl> wrote in message
> news:eo**************@TK2MSFTNGP09.phx.gbl...
> > Dnia 2003-11-13 12:53, U?ytkownik Atul napisa?:
> >
> > > Hi,
> > > I just stepped into C#. I am facing one problem. Here is the

scenario. I
> am
> > > posting some data to one website (https site). It returns me

response
> HTML.
> > > I want to parse this HTML and want to look for some specific
tags. To
> > > achieve the same, I wanted to use MSHTMLs HTMLDocumentClass

Interface. I
> > > dont know how to use it in C#.
> > > I am using .NET framework 1.1.
> > > For posting the data, I am using XMLHTTP class.
> > >
> > > Any help is highly appreciated.
> > >
> > > Thanks
> > > Atul
> > >
> > >
> > Hi,
> >
> > First you should add refernece to your project - Microsoft.mshtml,
> > then by namespace "mshtml" you will have access HTMLDocumentClass
> >
> > M.S
> >
>
>
>


Nov 15 '05 #8
hi Sunny,
Thanks for the response. Check the following code and see what am i missing
here?
private void button1_Click(object sender, System.EventArgs e)

{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)htmlDoc;

try
{
object[] oResponseHTML= (object[])getHtml();
MessageBox.Show(oResponseHTML.ToString());
doc.write(oResponseHTML);
if (null != doc)
{

MessageBox.Show(htmlDoc.all.length.ToString()+"\n" +doc.all.length.ToString()
);
}
richTextBox1.Text = "";

for(int i=0; i<doc.all.length;i++)
{
richTextBox1.Text = richTextBox1.Text + doc.all.item(null,i);
}

//richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

private object[] getHtml()
{
object[] strHTML=null;

XMLHTTP30Class xmlDoc = new XMLHTTP30Class();
xmlDoc.open("POST","http://www.google.com",false,"","");
xmlDoc.send(null);
if (xmlDoc.statusText.ToUpper() == "OK")
strHTML = (object[])xmlDoc.responseStream;
xmlDoc=null;
return strHTML;
}

Can you please correct this code?
Thanks
Atul
"Sunny" <su******@icebergwireless.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Atul,
I'm using this:

object[] oPageText = {sWebPage};
myDoc = new HTMLDocumentClass();
IHTMLDocument2 oMyDoc = (IHTMLDocument2)myDoc;
oMyDoc.write(oPageText);

This works fine. Of course you have to put this in try/catch block in
order the page is not well formated.

Hope that helps
Sunny
In article <uA**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com
says...
Hi,
I did the way you just told. Let me clear about the problem.
I am having one HTML text stored in a string say "strResponseHTML" variable. The code which I am trying to use is as follows:

private void button1_Click(object sender, System.EventArgs e)
{
HTMLDocument htmlDoc = new HTMLDocumentClass();
IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocumentClass();
try
{
string strResponse = getHtml();
htmlDoc.write(strResponse);
if (null != htmlDoc)
{
MessageBox.Show(htmlDoc.all.length.ToString());
}
richTextBox1.Text= htmlDoc.toString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message + "\n"+ex.StackTrace);
}
}

Now upon seeing the code, what actually I am trying to do is that I want to parse the response HTML to look for some objects with the values. Those
values I would like to compare.
We use MSXML2.dll to parse the XML document using XMLDOM, similary we "can" use MSHTML.dll to parse the HTML document using htmlDocument object. But how to load the strResponseHTML into HTMLDocument object, that I want to know. If any body could help me out, highly appreaciated.
Thanks
Atul

"Marcin Sm??ka" <ze***@eti.pg.gda.pl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Dnia 2003-11-13 12:53, U?ytkownik Atul napisa?:

> Hi,
> I just stepped into C#. I am facing one problem. Here is the scenario. I
am
> posting some data to one website (https site). It returns me
response HTML.
> I want to parse this HTML and want to look for some specific tags.

To > achieve the same, I wanted to use MSHTMLs HTMLDocumentClass Interface. I > dont know how to use it in C#.
> I am using .NET framework 1.1.
> For posting the data, I am using XMLHTTP class.
>
> Any help is highly appreciated.
>
> Thanks
> Atul
>
>
Hi,

First you should add refernece to your project - Microsoft.mshtml,
then by namespace "mshtml" you will have access HTMLDocumentClass

M.S


Nov 15 '05 #9
Hi Atul,

In article <e7**************@tk2msftngp13.phx.gbl>, py*****@hotmail.com
says...
hi Sunny,
Thanks for the response. Check the following code and see what am i missing
here? <Snip>
private object[] getHtml()
{
object[] strHTML=null;

XMLHTTP30Class xmlDoc = new XMLHTTP30Class();
xmlDoc.open("POST","http://www.google.com",false,"","");
xmlDoc.send(null);
if (xmlDoc.statusText.ToUpper() == "OK")
strHTML = (object[])xmlDoc.responseStream;
xmlDoc=null;
return strHTML;
}

For reading the web page I'm using:

string sUrl = "http://www.google.com";
System.Net.WebClient source = new System.Net.WebClient();
StreamReader mr = null;

try
{
mr = new StreamReader(source.OpenRead(sUrl));
sWebPage = mr.ReadToEnd();
}
catch
{
oParent.PagesDone++;
return;
}
finally
{
if (mr != null)
mr.Close();
}
Now, in sWebPage you have the HTML document. And you can transform it in
object[]:

object[] oPageText = {sWebPage};

Sunny
Nov 15 '05 #10
Hi Hasani,
thanks for the response. I still do not want to use save/read a file, so
the solution in that link may help. The problem is (as always) that
myknowledge in C++ is not something I'm proud of :). I have posted a new
thread to ask for help with the translation.

Thanks
Sunny

In article <s7*********************@twister.nyc.rr.com>, HJB417
@hotmail.c0m says...
http://support.microsoft.com/default...NoWebContent=1

I was trying to do it as microsoft told me, but the solution @ vbcity was
the quickest and simplest to implement. Microsoft's solution will probably
have the page loaded and parsed faster though.

Also, there's a property of one of the HTMLElement classes called 'all' and
it will return all HTML elements contained inside the invoked HTMLElement

I use the IPersistFile 'method' to load the html code. I had problems when
using HTMLDocument.write.
http://groups.google.com/groups?hl=e...40cpmsftngxa08

and the code I use the load the documents pretty much looks like this

htmlDoc = new HTMLDocumentClass();

System.Runtime.InteropServices.UCOMIPersistFile pf =
(System.Runtime.InteropServices.UCOMIPersistFile)h tmlDoc;

pf.Load(htmlFilename, 0);

while(htmlDoc.body == null)

System.Windows.Forms.Application.DoEvents();

Nov 15 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Colin Foulkes | last post by:
Hi, I've embedded a WebBrowser activeX control in my WinForms form. I'm having a problem accessing HTML elements in the "all" property of an mshtml.HTMLDocumentClass in my...
2
by: Gil Schulmann | last post by:
Hi. I am trying to load an HTML file into htmlDoc using c#. I see that the document does not load, but I can not understand where am I wrong. Any help ? My Code: class CFileHandler{...
10
by: Sunny | last post by:
Hi all, dev. env.: VS.Net2003/C# I have a windows form application with web browser control. I need to capture the onsubmit event of the forms in the document in order to get the values and log...
0
by: Joshua Ellul | last post by:
Hi There, Could anyone tell me how I can get all the source from a mshtml.HTMLDocumentClass (or any other interface or class). I need the source for the whole page and not just the body... The...
0
by: taminglis | last post by:
Ive got an mshtml.HTMLDocumentClass object that im populating the innerHTML property of directly. It works well except its stripping out comments and line feeds to suit itself... help. The...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
4
by: Nikolay Petrov | last post by:
How can I access the MSHTML object in Internet Explorer, from my app? I don't want to use the IE Control and put it in my app. I want to be able to do things with the opened document in the...
2
by: Alfa & Omega | last post by:
I have application that's using web browser (which is hidden in app but that's not the point). At some stage of working in my application I have to check HTML of current page that's in browser . ...
0
by: timeline | last post by:
VB-WEB: proint Job Name is about:blank followed by content to print C#-APP: Sending a Job to the Printer with Crystal Reports I am using mshtml.HTMLDocumentClass docObject=new...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.