By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,990 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,990 IT Pros & Developers. It's quick & easy.

Problem using component AxSHDocVw.AxWebBrowser.??

P: n/a
i was using component AxSHDocVw.AxWebBrowser,,but i rather confuces
because when i write
AxWebBrowser1.Document. the next option is Gettype function,,,nothing
else......
But when i write AxWebBrowser1.Document.all.tags("DIV").length() the
code is running well....WHY..?? i realy confuces because
AxWebBrowser1.Document.all it's not in the library but it's not
error.....why..???

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi jokolee

AxWebBrowser1.Document is of type Object, which has only one method:
GetType. However, the Document property implements several interfaces, such
as IHTMLDocument and IHTMLDocument2.

Type the following

DirectCast(AxWebBrowser1.Document, mshtml.IHMTLDocument2)

and at the end of the line press . (period). The intellisense should list
the methods and properties supported on this interface.

The reason why your code works is that (I suspect) you have Option Strict
off by default, and this allows late binding. So, at runtime, a check is
made to see if all.tags etc. is supported, which it is, so it works. I would
recommend turning Option Strict on and explicitly qualifying the type of the
objects you are using by applying DirectCast. It might be more typing but it
is more reliable and you will get the benefit of intellisense. It will also
run more quickly because late binding is expensive of time.

HTH

Charles
"jokolee" <jo**@jau.co-dot-id.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
i was using component AxSHDocVw.AxWebBrowser,,but i rather confuces
because when i write
AxWebBrowser1.Document. the next option is Gettype function,,,nothing
else......
But when i write AxWebBrowser1.Document.all.tags("DIV").length() the
code is running well....WHY..?? i realy confuces because
AxWebBrowser1.Document.all it's not in the library but it's not
error.....why..???

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.