Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > Is this a problem or am I just being thick..? {Web Browser Control}


Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2005, 09:23 AM
garyrussell garyrussell is offline
Freshman
 
Join Date: Apr 2004
Posts: 31
Default Is this a problem or am I just being thick..? {Web Browser Control}


Hi guys,

I am trying to loop trhu all the frames in the html doccument of the web browser. However it seems that some web sites have frames, in frames, which in turn have frames in, which in turn have frames in, and so on. I cannt seem to work out a suitable loop to go thru them all.

You may have 2 initial frames,
Frame one may have 1 additional frame in
Frame 2 may have 2 additional frmaes
One of the two addtional may have a frame, and so on.

How can I loop thru all frame checking the html.
Reply With Quote
  #2  
Old 09-08-2005, 09:46 AM
shawnrgr's Avatar
shawnrgr shawnrgr is offline
Junior Contributor
 
Join Date: Dec 2004
Posts: 218
Default

Show us what you have so far, and you'll get alot more help.
__________________
Set Brain = Nothing
Reply With Quote
  #3  
Old 09-08-2005, 11:08 AM
garyrussell garyrussell is offline
Freshman
 
Join Date: Apr 2004
Posts: 31
Default

I don't, that the thing! I found it out by using two for loops, but this only covers frames in frames.

<vb>
'loop thru each frame getting the document in it a checking for more frames
For FrameCnt = 0 To HTMLDoc.frames.length - 1

'store the current frames document as a document
Set HTMLDoc2 = HTMLDoc.frames(FrameCnt).document

For FormCnt = 0 To HTMLDoc2.Forms.length - 1
</vb>

but unless, I do some thing like create a default 10 nested for loops and hope no one has more than 10 frames within the main frame, it wont work.

I have thought though, I can do it if I can call the same sub I am actual in, I do remember something about it, very vague though.
Reply With Quote
  #4  
Old 09-08-2005, 11:44 AM
shawnrgr's Avatar
shawnrgr shawnrgr is offline
Junior Contributor
 
Join Date: Dec 2004
Posts: 218
Default

It will have to be recursive, kind of the same way you loop through directories to get sub directories.
__________________
Set Brain = Nothing
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->