Thanks Sergey, I just figured that out using Stephanie's code, because in running her code, I actually received an 'ie.document' is not an object error message which was easier to trace.
clear
ie = CreateObject("InternetExplorer.Application")
ie.Navigate('www.whatismyip.org')
lncount=0
DO WHILE TYPE('ie.document')<>"O" .and. lncount<10000000
lncount=lncount+1
ENDDO
lcIP = Strtran(Strtran(ie.Document.body.innerhtml, "< PRE >", ""), "< /PRE >", "")
? lcIp
Although your solution is cleaner and does not require STRTRAN():
loExplorer = CreateObject("InternetExplorer.Application")
loExplorer.Navigate2("www.whatismyip.org")
DO WHILE loExplorer.readystate <> 4
ENDDO
loDoc = loExplorer.Document
MyPublicIp = loDoc.Body.Innertext
? MyPublicIp
>Tracy,
>
>You've to wait for page to load. Something like.
DO WHILE loExplorer.readystate <> 4
>ENDDO
You'll have to add some code to exit loop on time out.
>
>>Hi Jamie,
>>
>>I receive an unspecified OLE error on the following line:
>>
>>loDoc = loExplorer.Document
>>
>>Using Windows XP SP1, IE6.0xpsp2
>>
>>What version of IE are you using where it works?
>>
>>>Robert
>>>I see. Try the following in your program:
>>>loExplorer = CreateObject("InternetExplorer.Application")
>>>loExplorer.Navigate2("www.whatismyip.org")
>>>loDoc = loExplorer.Document
>>>MyIp = loDoc.Body.Innertext
>>>
>>>
>>>HTH
>>>Jaime
>>>
>>>>no i want to do a program that will retrieve this ip
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"