![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
Is there a quick way to determine if a string exists somewhere an email's body without having to read it line-by-line? TIA, -T |
Ads |
#2
|
|||
|
|||
![]()
You have to parse Item.Body to see if the string is in there no matter what
you do. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "gamename" wrote in message oups.com... Hi, Is there a quick way to determine if a string exists somewhere an email's body without having to read it line-by-line? TIA, -T |
#3
|
|||
|
|||
![]()
Ken Slovak - [MVP - Outlook] wrote:
You have to parse Item.Body to see if the string is in there no matter what you do. So, you're saying that I have to read Item.Body line-by-line, and look in each string for a substring . There is no separate method to simply verify that a certain string does or does not exist somewhere inside of Item.Body. Correct? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "gamename" wrote in message oups.com... Hi, Is there a quick way to determine if a string exists somewhere an email's body without having to read it line-by-line? TIA, -T |
#4
|
|||
|
|||
![]()
On 9 Aug 2006 07:56:30 -0700, "gamename" wrote in
microsoft.public.outlook.program_vba: Is there a quick way to determine if a string exists somewhere an email's body without having to read it line-by-line? I don't know what you mean by "read it line-by-line"; AFAIK there is no such method to access the body of a message. This is the normal method to determine the existence and position of a string in a message's body: lngP1 = InStr(ActiveInspector.CurrentItem.Body,"fubar") For details, see Help on "Function InStr". -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
#5
|
|||
|
|||
![]()
As Michael said you just use Item.Body to read the entire body as one long
string. Then use InStr or some other string function to look for what you want. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "gamename" wrote in message ups.com... Ken Slovak - [MVP - Outlook] wrote: You have to parse Item.Body to see if the string is in there no matter what you do. So, you're saying that I have to read Item.Body line-by-line, and look in each string for a substring . There is no separate method to simply verify that a certain string does or does not exist somewhere inside of Item.Body. Correct? |
#6
|
|||
|
|||
![]()
Thanks guys, that answers my question.
When I said 'line-by-line', I meant a collection of strings delimited by control characters (like newline or null). Some environments will see entities similar to Body as a set of individual lines, and others treat it like a single string a chars. Evidently then, a mail message body in outlook is treated vb as one long string rather than lots of shorter ones. I'm rather new to VB, so I'm still getting the hang of it. Thanks again, -T |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I include quotes around a word in text string? | Maureen | Outlook and VBA | 3 | March 3rd 06 11:10 AM |
last string in txt file | Leech | Outlook and VBA | 1 | February 10th 06 07:13 AM |
Need String from Email Subject | CondtllyFrmttd | Outlook and VBA | 1 | January 25th 06 04:26 PM |
Use Part of Subject as String | CondtllyFrmttd | Outlook - General Queries | 0 | January 23rd 06 06:57 PM |
string variable that contains formatting | Martin | Outlook and VBA | 4 | January 19th 06 09:49 AM |