Hi Michel,
Can you explain what problem exactly do you have when you load the same file second time?
>When browser control placed onto form visually and this form runs, issuing navigate method even for the same local file ( assuming it was refreshed with the new content ) refreshes browser control without any problem. However, in a code below removing and adding subclassed browser control is required , otherwise we are in a loop for readystate. I am aware of CreateObject( "internetexplorer.application" ) which works properly with navigate method without need to instantiate it each time, but I need an alternative way for someone. My main concern is that the method below is very slow.
>
>Thanks
>Michael
>
>
>oparser = CREATEOBJECT('HTMLParser' )
>SCAN
> ltext = oparser.getInnerText(htmlfield )
>ENDSCAN
>
>
>DEFINE CLASS HTMLParser AS FORM
>
> FUNCTION getInnerText
> LPARAMETERS tcHTML
> ltext = ''
> TRY
> lcTemp = ADDBS(SYS(5)+CURDIR())+ SYS(2015)+ '.htm'
> STRTOFILE(tcHTML,lcTemp ,0)
>
>* required to avoid to achieve readystate
>
> IF VARTYPE(THIS.oie) = 'O'
> THIS.REMOVEOBJECT( "oIE" )
> ENDIF
> THIS.ADDOBJECT( "oIE" , "fbrowser" )
>***
> WITH THIS.oie
> .Navigate2(lcTemp)
> DO WHILE .ReadyState # 4
> WAIT WINDOW "" TIMEOUT .01
> ENDDO
> ENDWITH
> ltext = THIS.oie.DOCUMENT.body.innertext
> CATCH TO loexception
> ltext = ''
> ENDTRY
> RETURN ltext
> ENDFUNC
>ENDDEFINE
>
--sb--