Hi, I found this code on one of my computers and thought it might be usefull to someone. I did not write this code but i cannot remember who did. Please post if you are the writer of this code.

Put this code in a form
VB Code:
  1. Function get_ip()
  2. 'Fetch external ip function
  3. '- checks checkip.dyndns.org for computers ip adress
  4.     Dim ReturnedHTML As String, sIp As Long, sStop As Long
  5.  
  6.     ReturnedHTML = ReturnHTML("http://checkip.dyndns.org/")
  7.  
  8.     sIp = InStr(ReturnedHTML, "Address: ") + 9
  9.  
  10.     If InStr(sIp, ReturnedHTML, ",") > 0 Then
  11.         sStop = InStr(sIp, ReturnedHTML, ",")
  12.     Else
  13.         sStop = InStr(sIp, ReturnedHTML, "<")
  14.     End If
  15.  
  16.     If sStop > 0 Then 'Fetched ip
  17.         get_ip = Mid(ReturnedHTML, sIp, sStop - sIp)
  18.     Else 'Error occured
  19.         get_ip = "error"
  20.     End If
  21. End Function
  22.  
  23. Private Function ReturnHTML(URL)
  24. 'Return HTML function
  25. '- retrieves HTML for the given url
  26.     Dim objXMLHTTP, objRS, HTML
  27.     Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
  28.     objXMLHTTP.Open "GET", URL, False
  29.     objXMLHTTP.Send
  30.     HTML = objXMLHTTP.responseBody
  31.     Set objRS = CreateObject("ADODB.Recordset")
  32.     objRS.Fields.Append "txt", 200, 45000, &H80
  33.     objRS.Open
  34.     objRS.AddNew
  35.     objRS.Fields("txt").AppendChunk HTML
  36.     ReturnHTML = objRS("txt").Value
  37.     objRS.Close
  38.     Set objXMLHTTP = Nothing
  39.     Set objRS = Nothing
  40. End Function

The code can be used like this
VB Code:
  1. me.caption = Get_IP
  2. 'or
  3. text1.text = Get_IP
i did not write this code and i do not remember who wrote it.