MsgBox wanIPaddress, 64, “Find WAN Address”
Function wanIPaddress( )
‘ //Function uses WhatIsMyIP.com’s automation page:
‘ //http://www.whatismyip.com/automation/n09230945.asp
‘ //to find the WAN IP Address.
Dim szURL, objHTTP
On Error Resume Next
‘//Request data from whatismyip.com
szURL = “http://www.whatismyip.com/automation/n09230945.asp”
Set objHTTP = CreateObject( “WinHttp.WinHttpRequest.5.1″ )
objHTTP.Open “GET”, szURL
objHTTP.Send
If objHTTP.Status = 200 Then
wanIPaddress = objHTTP.ResponseText
Else
wanIPaddress = “IP = 0.0.0.0″ & vbCRLF & vbCRLF & _
“Unable to retrieve WAN IP from : ” & vbCRLF & _
“http://www.whatismyip.com/automation/n09230945.asp”
End If
Set objHTTP = Nothing
End Function