Parsing message body for non-breaking space

J

John@DerbyUK

I have a vba function that parses an outlook tempate to extract location,
start, end and size details for a permit request. My 'test' contractor has
set up the template and everything works fine with the exception of the size
value. They automatically add signatures to all outgoing mail. Between the
last character entered for size and the start of the signature is a
non-breaking space and a crlf character. I want to be able to use the instr
function to find the phrase 'SIZE: ' the value returned from this function
will be used to calculate the start position of a second instr function that
looks for the non-breaking space (what lies in between is the text I am
interested in). Well thats the theory BUT how do I reference the non-breaking
space?
 
M

Mark J. McGinty

John@DerbyUK said:
I have a vba function that parses an outlook tempate to extract location,
start, end and size details for a permit request. My 'test' contractor has
set up the template and everything works fine with the exception of the
size
value. They automatically add signatures to all outgoing mail. Between the
last character entered for size and the start of the signature is a
non-breaking space and a crlf character. I want to be able to use the
instr
function to find the phrase 'SIZE: ' the value returned from this function
will be used to calculate the start position of a second instr function
that
looks for the non-breaking space (what lies in between is the text I am
interested in). Well thats the theory BUT how do I reference the
non-breaking
space?


Chr(160)

That returns a string with a single character in it, it can be concatenated
to whatever else in the usual way.


-Mark
 
J

John@DerbyUK

Thanks MaRK

Mark J. McGinty said:
Chr(160)

That returns a string with a single character in it, it can be concatenated
to whatever else in the usual way.


-Mark
 
W

Wild Bill

Instr will locate a space, so
Instr(1, "Size:924 " & vbcrlf & "Cool Sig", " ")
works. Forgive me for not knowing what a non-breaking space is; what
I'm assuming is that you mean is a conventional space, or
Instr(1, "Size:924 " & vbcrlf & "Cool Sig", chr(32))
So change 32 to the character you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top