quan-chi
asked on
How can I Select a part of a text (automatic selection)
The thing is that using the Inet Control (http://checkip.dyndns.org/index.html) to get my IP it returns this: (with Text1.Text = Inet1.OpenURL)
<html><head><title>Current IP Check</title></head><body> Current IP Address: 200.43.19.76</body></html>
how can I put only the text, for exmple, between "Address:" and "</body>" ?
thx guys! ;)
<html><head><title>Current
how can I put only the text, for exmple, between "Address:" and "</body>" ?
thx guys! ;)
You can also write a regular expression.
strtemp = "<html><head><title>Curren t IP Check</title></head><body> Current IP Address: 200.43.19.76</body></html> "
strte = Mid(strtemp, InStr(1, strtemp, "Address") + Len("Address") + 1, Len(strtemp) - InStr(1, strtemp, "</body>"))
stradd = strte & " This is test "
strfin = Mid(strtemp, 1, InStr(1, strtemp, "Address") + Len("Address") + 1) & stradd & Mid(strtemp, InStr(1, strtemp, "</body>"))
strte = Mid(strtemp, InStr(1, strtemp, "Address") + Len("Address") + 1, Len(strtemp) - InStr(1, strtemp, "</body>"))
stradd = strte & " This is test "
strfin = Mid(strtemp, 1, InStr(1, strtemp, "Address") + Len("Address") + 1) & stradd & Mid(strtemp, InStr(1, strtemp, "</body>"))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
myString = "<html><head><title>Curren
finalString = Mid(myString, (InStr(1, myString, "Address:") + 8), Len(myString) - (InStrRev(myString, "</body>", -1)))
MsgBox Trim(finalString)