>>>Hi All,
>>>
>>>Even though I have done this a hundred times before, it seems to always comes back to bite me. I have HTML page with a tag with the id='count'. when I load it into the WebBrowser control and attempt to reference the tag the returned reference is NULL.
>>>
>>>HTML code
>>>
>>>... <td id='count'>123</td>
>>>
>>>
>>>VFP code
>>>
>>>loID = loForm.IE.document.getElementById( "count" )
>>>? loID
>>>
>>>
>>>I can see it in the Source View, and even in the browser Debug Console, but can not get the object reference via code in VFP. Is there a secret I am missing?
>>
>>If you're inside of frames, you'll need to navigate to the correct one. I got this code from Olaf Doschke on Tek-Tips. As I understand it, it would go like this:
>>
>>
CODE
>>oIE = createobject("internetexplorer.application")
>>oIE.navigate2("whatever.html")
>>Do While oIE.busy Or oIE.ReadyState!=4
>> doevents
>>Enddo
>>* looping all oFrames items in oFrames.item(n)
>>oFrames = oIE.Document.getElementsByTagName("iFrame")
>>For Each oFrame in oFrames
>> ? oFrame.contentWindow.Document
>> ? oFrame.contentWindow.Document.body.outerhtml
>> * Reference your element at: loEl = oFrame.contentWindow.document.getElementByID("content")
>> * When you get a non-null value, use this to access your content: loEl.innerHTML
>>Endfor
>>
>>UPDATE: Reference:
https://www.tek-tips.com/viewthread.cfm?qid=1663002>
>Thanks for the suggestion, but I have no iFrame. After playing around a bit I discovered the element is not available until the HTML page is visible. I can now get the object reference to it, but can not change the innerText. I get an error tell me that "innerText" is not valid. It appears in the Intellisense list, but evaluates to undefined.
>
>P.S. the 'contentWindow' reference may help. thanks.
Can you reference innerHTML?