Is this a problem or am I just being thick..? {Web Browser Control}

09-08-2005, 09:23 AM
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.

09-08-2005, 09:46 AM
Show us what you have so far, and you'll get alot more help.

09-08-2005, 11:08 AM
I don't, that the thing! I found it out by using two for loops, but this only covers frames in frames.

'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

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.

09-08-2005, 11:44 AM
It will have to be recursive, kind of the same way you loop through directories to get sub directories.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum