Computer Learning Zone CLZ Access Excel Word Windows

Knowing how to think empowers you far beyond those who know only what to think.

-Neil deGrasse Tyson
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Seminars > Email > Lessons >
Back to Email Seminar Lessons    Comments List
Upload Images   Link   Email  
Lesson26 Collecting Data Email
Travis Hagen 
     
2 years ago
I have a webform that returns an email similar to the example though the data is on the next line instead of after. Is there a way to retrieve that data with small changes to the code?  Thanks.

eg.

Name
Tom Johnson
Phone
555-555-5555
Email

Address
555 12th S
Scott Axton 
          
2 years ago
Access Developer 30, which I see you have, discusses File I/O and converting your data for import more in depth.

Without seeing the code you have currently we can't really advise how to tweak it to do what you need.  You probably need to post a snippet of your code or screen shots of same.
Travis Hagen OP 
     
2 years ago
Hi Scott.  Thanks for the reply.  I'll check out Developer 30. This is 100% Richards code and I haven't tried to use it yet.  It's purpose is to Parse data from an incoming emails table, in my case to collect new customer webform data. He searched for a string then selected the following data on that same line. I want to search for a string then select the data on the following line.   Here is his code:

Private Function CheckForString(inS As String, inLookFor As String) As String

    Dim P As Integer
    Dim S As String, LookFor As String
    
    S = inS
    LookFor = inLookFor
    
    P = InStr(S, LookFor)
    If P <> 0 Then
        S = Trim(Right(S, Len(S) - P - Len(LookFor) + 1))
    Else
        S = ""
    End If
    CheckForString = S

End Function

Private Sub Command1_Click()

    Dim DB As Database
    Dim RS As Recordset, RSout As Recordset
    Dim MsgBody As String
    Dim FF
    Dim OneLine As String, S As String, P As Integer
    
    Set DB = CurrentDb()
    Set RS = DB.OpenRecordset("IncomingT", dbOpenDynaset)
    Set RSout = DB.OpenRecordset("ResponseT", dbOpenDynaset)
    FF = FreeFile
    
    While Not RS.EOF
    
        RSout.AddNew
        MsgBody = RS!MsgBody
        Open "C:\Users\Richard\Desktop\TempFile.TXT" For Output As #FF
        Print #FF, MsgBody
        Close #FF
        
        Open "C:\Users\Richard\Desktop\TempFile.TXT" For Input As #FF
        While Not EOF(FF)
            Line Input #FF, OneLine
            
            S = CheckForString(OneLine, "First Name:")
            If S <> "" Then RSout!FirstName = S
            S = CheckForString(OneLine, "Last Name:")
            If S <> "" Then RSout!LastName = S
            S = CheckForString(OneLine, "Address:")
            If S <> "" Then RSout!Address = S
            S = CheckForString(OneLine, "City:")
            If S <> "" Then RSout!City = S
            S = CheckForString(OneLine, "State:")
            If S <> "" Then RSout!State = S
            S = CheckForString(OneLine, "ZIP:")
            If S <> "" Then RSout!ZIP = S
            S = CheckForString(OneLine, "Phone:")
            If S <> "" Then RSout!Phone = S
        
        Wend
        Close #FF
        
        RSout.Update
        RS.MoveNext
    
    Wend
    
    RS.Close
    Set RS = Nothing
    Set DB = Nothing
    
    MsgBox "Done."
    
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE * FROM IncomingT"
    DoCmd.SetWarnings True
    

End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Email Seminar Lessons.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/14/2025 8:10:19 AM. PLT: 1s