Got it...it seems that while VB is normally case-insensitive, using 'object' variables isn't.
'pDisp.Document' works
'pDisp.document' does not work
Bless you, Microsoft.
Main Topics
Browse All TopicsThe DocumentComplete event gives me two parameters: pDisp and URL.
The pDisp parameter is typed 'Object' and the documentation reports it is the WebBrowser or frame object which has triggered the event.
Each of those classes have a 'document' property, but quite often when the event is fired an error is raised when I try to access the 'document' property...even just testing if it "Is Nothing" which should be fairly harmless provided the member actually exists in the object...
...which seems to be the problem. the error that is generated when I try to access the document property is this:
"Object doesn't support this property or method"
This tells me that the object being passed in pDisp is NOT a WebBrowser or Frame, but something else...."what", I don't know.
Does anyone know how to determine the classname of the object contained in an 'object' variable?
Anyone know what the heck is going on to cause this error?
Thanks,
-JC
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'm going to award these points to anyone who can answer my other 'DocumentComplete event' question:
http://www.experts-exchang
By the way, since Visual Basic fiddles with text case in my code, I actually had to adjust the order of entries in my Project References to make VB start capitalizing 'Document' so the error would not occur.
Alternatively, I could declare a WebBrowser variable and set it to the pDisp parameter and then VB would capitalize properly...lazy programmer!
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
-->Delete - with points refunded
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER
GPrentice00
Cleanup Volunteer
Business Accounts
Answer for Membership
by: GhOsTIDPosted on 2003-06-11 at 16:58:29ID: 8704308
I think pDisp will be a pointer to your browser object.
So if your browser is called WebBrowser you should be able to test to see if pDisp = WebBrowser and try WebBrowser.document
Actually maybe i don't know what i'm talking about. I'll go and look around a bit in VB then come back and see if a better answer was supplied.