+ Reply to Thread
Results 1 to 14 of 14

Respond email using Outlook based in data in Range A9 (from attached file)

  1. #1
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Respond email using Outlook based in data in Range A9 (from attached file)

    Hi people,

    I hope someone can help me on this request.
    On a daily basis I receive many requests through Outlook asking for invoices. I need to ask someone else to create them respectively. The titles of those emails that I receive from customers have as subject these words "Natures sent a new Purchase Order ADG0246519". Words that never change are "sent a new Purchase Order".
    The Purchase order always change and may have only numbers or letter and numbers.

    In the attached file I have a basic code that helps me to ask my third party company to create the invoices however this macro creates a new email without considering the original request from my customer. What I want to do is solicit the creation of the invoice but I want the macro to look up in my Outlook and find the email that has the PO# in the subject. The PO# would be always in "A9" from sheet2 (in the attached workbook).

    If PO# is not find, exit the sub.
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    .
    If the email addresses in your macro code are valid addresses .. you might want to edit them to avoid spam.

  3. #3
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Hi Logit, these are not valid. Any suggestion on the code?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    .
    Sorry, I am not that familiar interacting with Outlook. I did a quick internet search on your request and located a ton of resources that explain
    how to search the SUBJECT field of your Outlook mail for a specific term. If no one responds to your request here, you may want to attempt
    an Internet search.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Let me take a shot at this, but I will need a bit more clarification. Will the PO number always be the next string after the words, "sent a new Purchase Order"? Also I see you have multiple lines for the same PO. Where does the rest of this information come from? Is there an attachment in the email or is this information embedded in the body somehow? (I am hoping that it is a well-formatted Excel spreadsheet attachment ).

    Could you mock up what the body or attachment would look like?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  6. #6
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Hi dflak,

    - Will the PO number always be the next string after the words, "sent a new Purchase Order"? YES
    - Also I see you have multiple lines for the same PO.... THIS IS CORRECT AND ALL OF THOSE LINES WILL BE ALWAYS THE SAME PO
    - Is there an attachment in the email or is this information embedded in the body somehow? ... THIS INFORMATION IS EMBEDDED IN THE BODY

    I have attached an example of emails that I receive and the one I send.
    Attached Files Attached Files

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    I am confused. The email on the bottom of the word document, is that what you get in or is it what you want to send out?

    If this is the mail you want to send out, I need some more information about this process of "get some data, run another macro ... create the excel file."

  8. #8
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Hi,
    I know this sounds confusing and appreciate your help.
    The email on the bottom of the word document, is that what you get in or is it what you want to send out? ... actually this is what I currently send out. However my wish is to use the original email (on the top of the word document) to reply and not create a new email.

    Hope this helps.

  9. #9
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    The only thing I can do with the original email is get the purchase order number from the subject line. I do not see were the rest of the information comes from.

  10. #10
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Yes, that is what I want to achieve, get the email from Outlook that has the PO from the subject line.

  11. #11
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    OK. If I extract the PO number, what do you want me to do with it? I cannot produce the email you want since I don't have the rest of the data.

  12. #12
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Hi, I attached a file that you can run, this is what you can use to send (emails are not valid).

    The goal is to look up the PO that is in range A9 within my outlook received emails, take the email that has in the subject the PO and send the information.
    Attached Files Attached Files

  13. #13
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    To make this code work, fill out the information on the Control Panel.

    Cell B1 is your mailbox name.

    Cell I2 is the name of a folder (see below)

    Cell J2 is the name of a subfolder (see below)

    Cell K2 is the name of the directory that contains the Excel file to which you want to write

    Cell B12 is the name of the file to write to. Use XXX as a "space holder" for the PO Number.

    Set up a folder directly under your inbox with a name matching the name in cell I2. Below this folder, set up a sub-folder with the name in cell J2.

    I suggest you write an Outlook filter rule to put the proper mail into the folder named in cell I2.

    When you click on the button, the program will read all the emails in the Main Folder, look for the key words "Purchase Order", find the PO Number, create a file called "PO Number XXX.xlsx" where XXX is the PO Number, write the PO number in cell A9, close and save the newly-created file. It also moves the email to the sub-folder so it does not get processed again.

    This is my understanding of what the requirement is. I was given no information to do more.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Respond email using Outlook based in data in Range A9 (from attached file)

    Thank you, it did work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Email data using outlook based on a cell range
    By mnunnley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-14-2016, 12:55 PM
  2. GMAIL: Attached file and paste range as image on the body of the email
    By albert28 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2015, 08:10 PM
  3. [SOLVED] Macro to attached sheet to outlook email
    By Rajesh shishodia in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2015, 10:46 AM
  4. [SOLVED] Macro to attached sheet to outlook email
    By Rajesh shishodia in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2015, 11:58 PM
  5. [SOLVED] VBA Email two different ranges to outlook (File and Code Attached)
    By JChesney in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-17-2015, 12:11 PM
  6. copy data from outlook attached excel file into a local one
    By s_samira_21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2014, 03:36 PM
  7. Want to change attached file name & subject line in the coding : Email Range
    By Kapil007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2010, 07:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1