Help!

Parsing message body for non-breaking space


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Set Default Path for Inserting an Attached File  
Author Message
JohnDerbyUK
External


Since: Aug 02, 2007
Posts: 2



PostPosted: Thu Aug 02, 2007 10:56 am    Post subject: Parsing message body for non-breaking space
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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?
Back to top
Mark J. McGinty
External


Since: Aug 27, 2004
Posts: 30



PostPosted: Thu Aug 02, 2007 1:36 pm    Post subject: Re: Parsing message body for non-breaking space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"John@DerbyUK" <JohnDerbyUK RemoveThis @discussions.microsoft.com> wrote in message
news:2EF678DE-FC6E-4C70-A1B2-5065E3DAF865@microsoft.com...
>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
Back to top
JohnDerbyUK
External


Since: Aug 02, 2007
Posts: 2



PostPosted: Thu Aug 02, 2007 2:34 pm    Post subject: Re: Parsing message body for non-breaking space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks MaRK

"Mark J. McGinty" wrote:

>
> "John@DerbyUK" <JohnDerbyUK RemoveThis @discussions.microsoft.com> wrote in message
> news:2EF678DE-FC6E-4C70-A1B2-5065E3DAF865@microsoft.com...
> >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
>
>
>
Back to top
Wild Bill
External


Since: Jul 26, 2007
Posts: 13



PostPosted: Fri Aug 03, 2007 2:16 am    Post subject: Re: Parsing message body for non-breaking space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum