Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:46:12+00:00 2026-05-29T10:46:12+00:00

I parse message data into a CSV file via Outlook rules. How can I

  • 0

I parse message data into a CSV file via Outlook rules.

How can I take the example below and store the text under "Customer Log Update:" into a string variable?

[Header Data]

Description: Problem: A2 – MI ERROR – R8036

Customer Log Update:
I’m having trouble with order #458362. I keep getting Error R8036, can you please assist?

Thanks!

View problem at http://…
[Footer Data]

Desired result to be stored into the string variable (note that the result may contain newlines):

I’m having trouble with order #458362. I keep getting Error R8036, can you please assist?

Thanks!

I haven’t attempted to code anything pertaining to my question.

Function RegFind(RegInput, RegPattern)
Dim regEx As New VBScript_RegExp_55.RegExp
Dim matches, s
regEx.Pattern = RegPattern
regEx.IgnoreCase = True
regEx.Global = False
s = ""
If regEx.Test(RegInput) Then
    Set matches = regEx.Execute(RegInput)
    For Each Match In matches
        s = Match.Value
    Next
    RegFind = s
Else
    RegFind = ""
End If
End Function

Sub CustomMailMessageRule(Item As Outlook.MailItem)

MsgBox "Mail message arrived: " & Item.Subject

Const FileWrite = file.csv `file destination

Dim FF1 As Integer
Dim subj As String
Dim bod As String

On Error GoTo erh

subj = Item.Subject
'this gets a 15 digit number from the subject line
subj = RegFind(subj, "\d{15}")

bod = Item.Body
'following line helps formatting, lots of double newlines in my source data
bod = Replace(bod, vbCrLf & vbCrLf, vbCrLf)

'WRITE FILE
FF1 = FreeFile
Open FileWrite For Append As #FF1
    Print #FF1, subj & "," & bod
Close #FF1

Exit Sub

erh:
    MsgBox Err.Description, vbCritical, Err.Number

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:46:13+00:00Added an answer on May 29, 2026 at 10:46 am

    Why not something simple like this:

    Function GetCustomerLogUpdate(messageBody As String) As String
        Const sStart As String = "Customer Log Update:"
        Const sEnd As String = "View problem at"
        Dim iStart As Long
        Dim iEnd As Long
    
        iStart = InStr(messageBody, sStart) + Len(sStart)
        iEnd = InStr(messageBody, sEnd)
    
        GetCustomerLogUpdate = Mid(messageBody, iStart, iEnd - iStart)
    End Function
    

    I tested it using this code and it worked:

    Dim messageBody As String
    Dim result As String
    
    messageBody = "Description: Problem: A2 - MI ERROR - R8036" & vbCrLf & _
        "Customer Log Update:" & vbCrLf & _
        "I 'm having trouble with order #458362.  I keep getting Error R8036, can you please assist?" & vbCrLf & _
        "Thanks!" & vbCrLf & _
        "View problem at http://..." 
    
    result = GetCustomerLogUpdate(messageBody)
    
    Debug.Print result
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a very large chunk of data into a new MongoDB
I have this XML file that I parse into its elements and create a
I parse data using JSON in javascript, I find this is very convenient. But
I parse some values from an xml file. There is a @25-12-2010'T'23:40:00 string with
I parse an xml file containing books, for each new node I go: Book
I'm wanting to parse a string into a nullable int in C#. ie. I
I use the following code to pass data into a website: require net/http params
I've got a chat program which pushes JSON data from Apache/PHP to Node.js, via
I'm aware that serializing is used to convert data types into a storable format,
What's the cleanest way to convert data (field values) when storing/loading into/from a database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.