Results 1 to 15 of 15
  1. #1
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8

    Red face Create a macro to export data from body of email to access database

    So I am a complete newbie. I know vaguely from google searches that this type of thing is possible but I have no idea how to go about it.

    I get a specific email multiple times a day, I have a rule sending them to a specific folder. Those emails are a form people fill out and I need that data in my access database. At this time I enter in everything manually and I would really like to streamline the process and stop wasting time.

    So the data is this:
    Date Pet was Lost
    Pet's Name
    Type of Pet
    Sex
    Location Lost
    Color
    Ears
    Coat
    Coat Texture
    Tail
    Recently groomed?
    Declawed?
    Describe Your Pet
    Was your pet wearing a collar?
    File
    Photo
    Your Name
    Phone
    Email
    I think what I need is a macro. I don't necessarily want it running in the background or anything. I don't mind opening outlook and my database and running whatever it is I need to do. Does this make sense? Am I posting in the right place?


  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Please tell us more about your Access database.

    There is a free data model for lost and found Pets here.

    Welcome and good luck with your project.

  3. #3
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    My fiancé made the database, he's in IT but doesn't really know how to do a lot with databases. I have a form where I enter in the data:
    Click image for larger version. 

Name:	lost pet.PNG 
Views:	8 
Size:	31.7 KB 
ID:	31420

    Click image for larger version. 

Name:	ownerinfo.PNG 
Views:	8 
Size:	14.4 KB 
ID:	31422

    I have a pet info table and an owner info table. Am I answering your question right?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Start by linking to the Inbox
    - External Data
    - more
    - Outlook

    Then follow the wizard. Now you have all your emails available to you in Access. Look at the data and decide what you want to extract, then create a query for it.

  5. #5
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    I have tried that before. All that way does is extract the emails and subject of those emails. It creates a new table. I want the data from the body of the email. If I can't do it straight to access because the database is set up different then the report I understand that. I could export the data from outlook into excel and then put the columns in the right order to import into the database.

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Linking does not create a new table, it creates a pointer to the existing "table" in Outlook. It does not extract either, so not sure what you have tried before. What Outlook are you using?

  7. #7
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    2010.
    So choose the third option? I was choosing the first option.
    Click image for larger version. 

Name:	link.PNG 
Views:	8 
Size:	17.1 KB 
ID:	31424

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Yup! That will give you access to the body of the emails.

  9. #9
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    All it did was grab the inbox data.

    Click image for larger version. 

Name:	data.PNG 
Views:	8 
Size:	52.9 KB 
ID:	31425

  10. #10
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I thought that was what you wanted?

  11. #11
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    No, that is just the subject of the email, the email address. I am wanting the data from the body of the email. The stuff from the very first post, the list (the answers to those questions).

  12. #12
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    It is in the column "Contents". You can use the InStr function to parse out what you want.

  13. #13
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    Quote Originally Posted by aytee111 View Post
    It is in the column "Contents". You can use the InStr function to parse out what you want.
    The contents it brought over is only the first sentence of the email body unfortunately.

  14. #14
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure why that is, for me it is the entire email body. Did you copy and paste it into something like Notepad or did you just visually look at it?

  15. #15
    GetToTheGate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    8
    I just visually looked at it. When I select the contents of that cell it shows me everything.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export html to body of email issue
    By mmart33 in forum Reports
    Replies: 3
    Last Post: 02-28-2013, 03:16 PM
  2. sending data into an email body - outlook
    By webisti in forum Access
    Replies: 6
    Last Post: 02-15-2012, 07:05 AM
  3. update database using email body text
    By ravindramn in forum Import/Export Data
    Replies: 0
    Last Post: 05-19-2011, 06:34 AM
  4. Import Data from a Table in the Body of an Email
    By a1195423 in forum Import/Export Data
    Replies: 0
    Last Post: 03-24-2011, 01:55 PM
  5. Export Contents of a Report into Email Body
    By Nosaj08 in forum Reports
    Replies: 4
    Last Post: 05-27-2009, 09:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums