Hi,
I found this function to get my public IP:
Now, it all looks very nice and all, but how do I get the result from that function? i.e. I would like the IP address displayed on a report...
Thank you!
I found this function to get my public IP:
Code:
Function GetMyPublicIP() As String
Dim HttpRequest As Object
On Error Resume Next
'Create the XMLHttpRequest object.
Set HttpRequest = CreateObject("MSXML2.XMLHTTP")
'Check if the object was created.
If Err.Number <> 0 Then
'Return error message.
GetMyPublicIP = "Could not create the XMLHttpRequest object!"
'Release the object and exit.
Set HttpRequest = Nothing
Exit Function
End If
On Error GoTo 0
'Create the request - no special parameters required.
HttpRequest.Open "GET", "http://myip.dnsomatic.com", False
'Send the request to the site.
HttpRequest.Send
'Return the result of the request (the IP string).
GetMyPublicIP = HttpRequest.ResponseText
End Function
Now, it all looks very nice and all, but how do I get the result from that function? i.e. I would like the IP address displayed on a report...
Thank you!