I think I got it:
Using my example thi get's the Frame:
Code:
oie = CreateObject("internetexplorer.application")
oie.Navigate2("file:///C:/my/frameset.html")
oFrame = oIE.document.getElementsByTagName("iframe")
Now to get the paragraph tag with ID "content" from within that frame:
oContent = oFrame.item(0).getElementByID("content")
? oContent.innerhtml
And I now see the essential difference of the different getElement-functions of javascript and the DOM: If it's one element by the name of the function (eg getElementByID, as an ID has to be unique), then the resulting object is the tag node itself.
The function getElementsByTagName() on the other side has the plural Elements in it, and generally returns a collection of tag nodes as items collection, therefor even if it's just one frame you need item(0), oFrame is not the frame itself, it is a tag node collection with only one item in it.
In one step you can make it:
Code:
? oIE.document.getElementsByTagName("iframe").item(0).contentWindow.document.getElementByID("content").innerHTML
But there is no way getting more direct to the paragraph with ID "content", you first need a grip on the inner document of the iFrame.
Your mention of "contentWindow" helped a lot.
So more general in a case you want to get at the document object of a frame you
Code:
oIE = createobject("internetexplorer.application")
oIE.navigate2("file:///C:/my/frameset.html")
Do While oIE.busy Or oIE.ReadyState!=4
doevents
Enddo
oFrames = oIE.Document.getElementsByTagName("iFrame")
* looping all oFrames items in oFrames.item(n)
For Each oFrame in oFrames
? oFrame.contentWindow.Document
? oFrame.contentWindow.Document.body.outerhtml
Endfor
And with oFrame.contentWindow.Document you can begin your real search for the element with ID "MobNo1". If you have more than one iFrame in the outer document you need to see which one contains the tag you're really after.
Bye, Olaf.