1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

MS Outlook 2007 Macro NEED HELP

Discussion in 'Business Applications' started by hollowaystevea, Jan 29, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. hollowaystevea

    hollowaystevea Thread Starter

    Joined:
    Jan 29, 2011
    Messages:
    3
    Hello!

    I've designed a spreadsheet in excel that can automatically send text messages to everybody in my workplace. This spreadsheet can also confirm replies from the people within my office with conditional formatting. The process is very fluid and really only has one kink.

    MS Outlook is used to send the text messages. When a reply comes in to my inbox, it is placed in a folder called "Recall" using auto-rules. Once the replies are in the Recall folder I can manually output the contents of the entire folder into a file named "replies.csv". Once this file is outputted, excel pulls in the data automatically and updates the status of the RECALL.

    Long story short...

    I need a macro that runs in Outlook. This macro needs to be able to automatically export the "Recall" folder to a .csv file every time a new message is detected in the "Recall" folder. The macro also needs to export the "Recall" folder to a .csv each time a message is deleted from the "Recall" folder. I only want to export the FROM portion of each e-mail. I do not want to be prompted to overwrite the file each time.

    Any assistance would be greatly appreciated! This will land me some big Kudos in the office!!

    --Steve--
     
  2. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Can you post a sample CSV file?

    Rollin
     
  3. hollowaystevea

    hollowaystevea Thread Starter

    Joined:
    Jan 29, 2011
    Messages:
    3
    Rollin,

    Thanks for the reply!! I attached a sample csv file. I had to upload it as a xls file because this forum wouldn't accept a .csv upload. I don't exactly know why. You can save it as a CSV on your end to get an idea of what I am talking about!

    A couple of additional details I may have left out:

    1. File must be a Windows Comma Separated (.csv) file
    2. I only require the "From" field in each e-mail in the Outlook Folder "Recall" to be exported

    Thanks!!!
     

    Attached Files:

  4. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Outlook 2007 has the ability to run a macro using rules. This will make things much easier for you. Since the code will be fired when each message is received you can use macro logic to open the existing .CSV file and append the new record to the end of the file instead of creating a brand new .CSV file each time. The macro would then move the email to the appropriate folder. Does that sound like it would work for you?

    Rollin
     
  5. hollowaystevea

    hollowaystevea Thread Starter

    Joined:
    Jan 29, 2011
    Messages:
    3
    That wouldn't work in this scenario. I need the csv file to be overwritten by the contents of the entire folder in Outlook.

    If the folder in outlook is empty, then the csv should contain no data. Appending data to the csv would give my workbook the sense that people are still replying to the message. I can export this type of file manually. Surely there must be some way of doing the following.

    SUB AutoExportCSV()

    When mail received in "Recall"

    When mail deleted in "Recall"

    FILE

    EXPORT "Recall"

    Windows Comma Separated(.CSV)

    Choose fields FROM

    Save As ...replies.csv

    Eliminate Overwrite Prompt

    Something like this...but in a language the CPU understands!!

    Thanks!
     
  6. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    It shouldn't be a problem to perform this action on new incoming mails but as far as I know there is no event that is triggered when an email is deleted. This means you would have to manually run the macro after deleting your specific emails. The only other option would be to design a custom form that would display the emails in a listbox and you would trigger the delete from this form instead of using the standard Outlook window . This method would be complicated and just as much trouble as manually running the macro after deleting.

    Rollin
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/977697

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice