![]() |
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
|
|||
|
|||
![]()
I am trying to create a custom field in a view. I want to use the InStr
function to scan the text of the message and find some particular content. I've been using functions like the following: Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) The only problem is that the function doesn't always work like I think it will, and a little bit of troubleshooting reveals that Outlook only seems to look at the first 255 chars of the [message] field. The Len() function always returns a maximum of "255" even if there is more to the text of the message. Is there any way to access the full text of the message in a calculated field or am I just stuck? Or do I need to start writing forms or full-blown plugins? Josh |
#2
|
|||
|
|||
![]() It's hard to tell what that monster is expected to do. Could you explain in plain text? -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Fri, 21 Dec 2007 22:07:54 -0800 schrieb Josh Andrews: I am trying to create a custom field in a view. I want to use the InStr function to scan the text of the message and find some particular content. I've been using functions like the following: Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) The only problem is that the function doesn't always work like I think it will, and a little bit of troubleshooting reveals that Outlook only seems to look at the first 255 chars of the [message] field. The Len() function always returns a maximum of "255" even if there is more to the text of the message. Is there any way to access the full text of the message in a calculated field or am I just stuck? Or do I need to start writing forms or full-blown plugins? Josh |
#3
|
|||
|
|||
![]()
Haha, good point. I should have done so before.
Basically I have a web apps that tracks software issues on a project I work on. It sends out e-mails whenever an issue is opened, updated, closed, etc. But the from, to, addresses, etc. in the e-mail headers are not informative and neither are the subjects of the e-mails. I am trying to create a calculated field that does some string parsing to pull the e-mail address out of the message body. Not all e-mails are in the same format, but there is usually a text string "Additional Comments From:" prefixing the actual e-mail address somewhere in the body. So the function below tries to find the location of the "Additional Comments From" text string in the body of the message, then use that as the starting point for grabbing the text after it (which should be the e-mail address.) It chops off all text after the e-mail address and before. And it works OK when the e-mail address and the "Additional Comments From" string are in the first 255 chars of the message, but no go afterwards. So I am wondering if there is another field I can use that will give me the full message body. Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) Josh Michael Bauer [MVP - Outlook] wrote: It's hard to tell what that monster is expected to do. Could you explain in plain text? -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Fri, 21 Dec 2007 22:07:54 -0800 schrieb Josh Andrews: I am trying to create a custom field in a view. I want to use the InStr function to scan the text of the message and find some particular content. I've been using functions like the following: Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) The only problem is that the function doesn't always work like I think it will, and a little bit of troubleshooting reveals that Outlook only seems to look at the first 255 chars of the [message] field. The Len() function always returns a maximum of "255" even if there is more to the text of the message. Is there any way to access the full text of the message in a calculated field or am I just stuck? Or do I need to start writing forms or full-blown plugins? Josh |
#4
|
|||
|
|||
![]() In fact, the result depends not only on the body's length but also on its content. You might use VBA instead, add a User Property to every item and store the function's result in it. -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sat, 22 Dec 2007 01:15:25 -0800 schrieb Josh Andrews: Haha, good point. I should have done so before. Basically I have a web apps that tracks software issues on a project I work on. It sends out e-mails whenever an issue is opened, updated, closed, etc. But the from, to, addresses, etc. in the e-mail headers are not informative and neither are the subjects of the e-mails. I am trying to create a calculated field that does some string parsing to pull the e-mail address out of the message body. Not all e-mails are in the same format, but there is usually a text string "Additional Comments From:" prefixing the actual e-mail address somewhere in the body. So the function below tries to find the location of the "Additional Comments From" text string in the body of the message, then use that as the starting point for grabbing the text after it (which should be the e-mail address.) It chops off all text after the e-mail address and before. And it works OK when the e-mail address and the "Additional Comments From" string are in the first 255 chars of the message, but no go afterwards. So I am wondering if there is another field I can use that will give me the full message body. Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) Josh Michael Bauer [MVP - Outlook] wrote: It's hard to tell what that monster is expected to do. Could you explain in plain text? -- Best regards Michael Bauer - MVP Outlook Synchronize Outlook Categories: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Fri, 21 Dec 2007 22:07:54 -0800 schrieb Josh Andrews: I am trying to create a custom field in a view. I want to use the InStr function to scan the text of the message and find some particular content. I've been using functions like the following: Left(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From")))),InStr(Right([Message],((Len([Message])-InStr(1,[Message],"Additional Comments From",1)-Len("Additional Comments From"))))," ")) The only problem is that the function doesn't always work like I think it will, and a little bit of troubleshooting reveals that Outlook only seems to look at the first 255 chars of the [message] field. The Len() function always returns a maximum of "255" even if there is more to the text of the message. Is there any way to access the full text of the message in a calculated field or am I just stuck? Or do I need to start writing forms or full-blown plugins? Josh |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Populate Message field based on custom field | Kryer | Outlook - Using Forms | 8 | September 7th 07 11:19 PM |
How to edit message field in an outlook message form | Liz | Outlook - Using Forms | 3 | July 24th 07 10:09 PM |
Populating a standard message in the message field | stone | Outlook - Using Forms | 1 | July 11th 07 01:08 AM |
Edit Message field | Long Nguyen | Outlook - Using Forms | 1 | August 18th 06 01:35 PM |
To field error message | chucksphar | Outlook - Using Contacts | 11 | February 16th 06 03:49 AM |