Set mainFrm = Nothing
Do While mainFrm Is Nothing
For i = 0 To .Document.parentWindow.Frames.Length - 1
If
.Document.parentWindow.Frames(i).Document.Forms.Length > 0 Then
If
.Document.parentWindow.Frames(i).Document.Forms(0).name = "main" Then
Set mainFrm =
.Document.parentWindow.Frames(i).Document.Forms(0)
Debug.Print "Main Form"
For j = 0 To mainFrm.Elements.Length - 1
Debug.Print mainFrm.Elements(j).name
Next
End If
End If
Next
Pause 2 ' doEvents for 2 seconds
Loop
The page is slow in loading, even after busy is false and ReadyState =
4 and the first time around the main form does not exist so I use a
loop. None of the submit inputs shows up in the elements array. I
thought I could get around this by setting the PostData myself using
Navigate2 but then IE puts up an error dialog box about a page being
redisplayed. What am I doing wrong?