I am supposed to return the content value within the tags "<RESULT>SUCCESS</RESULT>". So I had code it as <% tmpStartPos = InStr(StrObject, "<RESULT>") + 8 '8 is the length of string "<RESULT>" tmpEndPos = InStr(StrObject, "</RESULT>") Set sContent = Mid(StrObject, tmpStartPos + 1, tmpEndPos - tmpStartPos) %> but when i try to print out the sContent value, i got nothing. Can anyone pls point out to me what's the problem? Thanks alot.
Why don't you remove that Set keyword before sContent variable. So that line must be like this: sContent = Mid(StrObject, tmpStartPos + 1, tmpEndPos - tmpStartPos) The keyword Set is used for setting objects, but in this case you are just setting a string variable. No need to use Set there.