Cannot Dechiper Encoded String
Sorry, I didn't express myself clearly enough.
The value of el, as seen in the watch window in the value column, is
what I meant when I typed el.value. I'm actually accessing "el", not
"el.value'. I apologize for the confusion.
Also, I recently realized that the debug window is showing
?subject=Got%20ize %20" for el, whereas
when I look at the web page source, that same line of data that I'm
capturing as "el", shows up as:Gov't Seized
So that explains why it's not working for me. By the time the
datastring is captured by a variable something has already discarded
the characters that need translating.
I'm getting el this way:
Set IeDoc = obIe.document
el = IeDoc.getElementsByTagName("HR")
el = el.nextSibling.nextSibling
Here's where I started to copy the data from the web page source, and
that's when I realized - the data I'm trying to translate doesn't
exist in the line of data I'm capturing! It had already been
removed! No wonder it didn't work!
So, from there it was easy to figure out. I needed to grab that data
from a different element. And I did. And now it works.
Many thanks to both of you for your help, you led me to the actual
problem. Couldn't of done it without either of you.
On Nov 16, 9:40*am, Ron Rosenfeld wrote:
On Sun, 16 Nov 2008 09:00:24 -0800 (PST), Dudely wrote:
The string value of el is composed of letters & numbers that make up
an email address, +1. *It comes in the form of: **@*.* and is composed
of a random number of characters followed by ?subject= followed by the
actual subject string. *The value of theSpot is equal to the number of
characters in the email address. *If in fact the email address were
, then the corresponding values would be:
?subject=B ank
Seized
theSpot=the number of characters between the start of the value and
the word "subject" and is obtained by the expression: theSpot = InStr
(el, "subject")
The subject string=Bank Seized
I suspect something odd about the code you have not posted. *Perhaps if you
posted all of your code, and not just bits and pieces, it might be helpful.
The following seems to work as expected:
=====================
Option Explicit
Const e1 As String = _
?subject=Bank Seized"
Sub foo()
Dim SubjectString As String
Dim i As Long
Dim theSpot As Long
* * theSpot = InStr(e1, "subject")
* * SubjectString = Mid(e1, theSpot + 8)
For i = 32 To 127
* * SubjectString = Replace(SubjectString, "&#" & i & ";", Chr(i))
Next i
Debug.Print SubjectString
End Sub
====================
--ron
|