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:
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?
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
How can I convert this string into a value that will remain uncorrupted after being stored outside its original variable?