Link to home
Start Free TrialLog in
Avatar of Sharon
SharonFlag for United States of America

asked on

find find asterisks in a string

I am pulling the body of out of an Outlook message.  There are two rows of asterisks and I need to pull the text between the two rows.

There are various lines of text above the asterisks.  The text between the asterisks will have various lines too. Thanks so much!

'**********************
Reason for denial:
'**********************
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Will there be asterisks anywhere else in the message text?
Will there always be the same number of asterisks?

Is this the only text in the body?

You might be able to use the Split() function to parse the text on the vbcrlf character

myText = Split(strBody, vbcrlf)

Then loop through the myText array looking for the asterisks, then concatenate the array elements between the "'***********" strings, or you could use the Replace function, something like:

myText = Replace(strBody, "*", "")
Avatar of Sharon

ASKER

I could look for the word "denial:" and then I would need to pull the text until it gets to second line of astrisks.  Yes, the two lines of asterisks will be the only ones in the emai.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sharon

ASKER

That is totally awesome! Very elegant! Works like a charm. Thanks!!
glad I could help.