Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non-standard characters in string variable

Status
Not open for further replies.

Schroeder

MIS
Sep 25, 2001
382
US
I'm retrieving a string using the MSHTML.IHTMLTxtRange.getBookmark function. This returns an "opaque string" representing the IHTMLTxtRange of a WebBrowser.Document object. I'd like to store this string to use at a later date to return to the same range.

The problem is, when I move the value from the string variable to store it, it gets changed. Looking at the before and after values in the immediate window, they look identical but when I compare the variables (?strOne = strTwo), they are not equal. I'm guessing this has something to do with background Unicode <-> ANSI conversion being performed by VB.

I'd like to convert the string to some other form to make it easier to store. I've tried converting to a Unicode byte array hoping to just store the list of byte values but when I convert back, it's not the same value.

This:
Code:
StrConv(StrConv(strTest, vbFromUnicode), vbUnicode) = strTest
evaluates to FALSE using the string that getBookmark method returns.

How can I convert this string into a value that will remain uncorrupted after being stored outside its original variable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top