+ Reply to Thread
Results 1 to 8 of 8

Saving email bodies as text files in Hard Drive in Outlook

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2003
    Posts
    9

    Saving email bodies as text files in Hard Drive in Outlook

    Hi guys,
    I'm fairly new to Outlook VBA programming so I'm in a bit of a fix. I've been trying to find a macro that can automatically save the emails in my inbox folder to another folder that i created on my hard drive named 'Documents\Outlook_Mail\Data' as text files so that I can import them into a database. I want to save the body part of the emails, not the attachments.
    I scoured the net and found this macro but it keeps sending me the following error: "This folder doesn't exist". I guess problem is how I've set the object folder.

    Please Login or Register  to view this content.
    Could anyone assist me with this code? I would highly appreciate your assistance. Or if possible, help me with another piece of code that can function in the way specified. Thanks in advance

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Saving email bodies as text files in Hard Drive in Outlook

    How about this?

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    06-07-2011
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Saving email bodies as text files in Hard Drive in Outlook

    It works perfectly!! Thanks!!

    Just one more question, I also wanted to place the files in monthly folders such that every file saved on the hard drive will go to that month's folder, e.g. files received today will go to the June_2011 folder. Do you know a way of doing this?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Saving email bodies as text files in Hard Drive in Outlook

    Try this:

    Please Login or Register  to view this content.

    It will also check if a folder exists for the month and create one if not.

    Dom

  5. #5
    Registered User
    Join Date
    06-07-2011
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Saving email bodies as text files in Hard Drive in Outlook

    I'm sure the code works just fine but when I try running it it brings up a pop-up that says "Outlook cannot complete the save due to a file permission error".what might the problem be, because I have the required access to the mail in outlook.

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Saving email bodies as text files in Hard Drive in Outlook

    Oops.

    This:

    Please Login or Register  to view this content.

    should be:

    Please Login or Register  to view this content.

    Dom

  7. #7
    Registered User
    Join Date
    06-07-2011
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Saving email bodies as text files in Hard Drive in Outlook

    It works beautifully!! Thanks so much!!

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Saving email bodies as text files in Hard Drive in Outlook

    Cool, if you are happy with the solution please mark the thread as solved.

    f your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.
    Dom

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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