Solved

How to export outlook mail to folder on my PC

Posted on 2011-03-24
18
423 Views
Last Modified: 2012-05-11
Hi All,

I am looking for a way/program that will allow me to export mail from Outlook to a folder on my PC.

e.g All mail from john@example.com and export them to C:\<Foldername>.

Thanks in advance!
0
Comment
Question by:kdonnelly81
  • 7
  • 7
  • 2
  • +2
18 Comments
 
LVL 10

Expert Comment

by:Michael_MCDST
ID: 35205781
It is a rather easy procedure but the methods vary a bit depending upon which version of Outlook you are using.
General guide;
http://support.microsoft.com/kb/287070

Outlook 2007, 2003, 2000 and Outlook Express guide;
http://www.sitedeveloper.ws/tutorials/outlook.htm

Outlook 2010;
http://www.addictivetips.com/windows-tips/office-outlook-2010-import-and-export/

0
 
LVL 3

Expert Comment

by:MicMatic
ID: 35205800
You can just drag the messages from Outlook to a folder on your PC...

If you only want those from one sender, first sort the messages by sender to make your life just that bit more easy :-)
0
 

Author Comment

by:kdonnelly81
ID: 35205869
Hi Lads,

Thanks for the quick response. But what I am looking for is something like a rule that will export email's from a certain sender and put that email into a folder on my Pc (Not as a PST).

Something like MicMatic was saying but automatically.

0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:kdonnelly81
ID: 35205879
PS Sorry I didn't make that bit clear in my first post!!
0
 
LVL 44

Expert Comment

by:Jackie Man
ID: 35205941
I think that there is no free solution for your request.

First of all, you can create a temporary pst file. Then, create a rule to copy all emails from a specific sender to a folder in the temporrary pst file.

Finally, download and install SysTools Outlook Conversion to convert the temporary pst file to msg files (i.e. the emails) to a folder on your PC.

SysTools Outlook Conversion will cost you $49 and trial can be downloaded from http://www.outlookconversion.com/convert-outlook-mailbox.html
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35206092
We can certainly do this using VBA if that is ok?

Question is really how do you want to define the 'collection' characteristics and where in DOS do you want the messages posting ... and do you want to keep a representative folder structure under your root dos folder.

Also note it could take a while to execute ... but do it we can!

Chris
0
 

Author Comment

by:kdonnelly81
ID: 35206218
Hi jackieman,

That sounds like a plan. I will try that out thanks again!

Ps Any other ideas would be greatly appreciated.
0
 
LVL 44

Expert Comment

by:Jackie Man
ID: 35206279
Technically, it is feasible but you will encounter a problem in exporting the emails as follows.

Eevery email can be exported as a msg file and the file name of the msg file is named according to the subject line of the email. So, if two emails have the same subject line and is from the same sender, I am not sure whether the software is intelligent enough to change the name of the newly exported msg file so that the new msg file will not overwrite the old one.

So, a trial is a MUST before you buy or some of the exported emails will be missing after the conversion.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35206451
If you want to pursue the VBA route then ask because for now I am assuming you would rather pay than do it with VBA.

Chris
0
 

Author Comment

by:kdonnelly81
ID: 35207169
Hi Chris,

How would i go about this as I have no VB myself. I am waiting to hear back from a friend who does know VB. Can you please explain how I could do this in VB.

Also Thanks to jackieman Thats looks great but if i can do it with VB than all the better.

Thanks to all for posting!!!!
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35208508
What would it involve:

Me, (or one of us at any rate) producing some code to your 'specification' that when inserted into the outlook client will do what you want.  As long as VBA is not inhibited, (IT policy for example) then we can code it up to work ... in order to some simple pre tests, what version of outlook?

Chris
0
 

Author Comment

by:kdonnelly81
ID: 35208583
Hi Chris,

That sounds great, I am the IT Administrator in here so there shouldn't be any problems with IT policies. Another problem is I would need it to work on all ver of Outlook if possiable, or from 2003 - 2010.

I want to be able to import the mails into a CRM system we have in here.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35208693
1. How do you want to trigger the macro ... to be easily valid for all versions the hot key for macros of alt + F8 would be the easiest ... from there you would select a macro and select run - sound ok?,  (note unless you have macros this will not work).

In order to do a test put the following code into a module:

1. Alt + F11 to display the VB Editor
2. Insert|  Module
3. Paste the supplied code\

Close the VBE and try the alt + F8 sequence to run the macro.  If it doesn't work check macro security setting

Chris


To Create a macro:
------------------

Alt + F11 to open the macro editor

  For User Code:
     Insert | Module to insert a code module into the project
     In the project tree select the module.
     Insert the required macro(s) into the selected module, ('Module1' or similar)

Close the Visual Basic Editor.

To run a macro:
---------------

Alt + F8
Select the macro
Select 'Run'

Check Security as appropriate:
------------------------------

In the application select Tools | Macro | Security
=========================
2003 and earlier
-------------------------
      : Select Medium
      : Select OK
=========================

==================================================================================
2007
----------------------------------------------------------------------------------
      : Outlook Application - Warnings for all Macros
----------------------------------------------------------------------------------

sub Q_26908386()
    msgbox "Hello There!"
end sub

Open in new window

0
 

Author Comment

by:kdonnelly81
ID: 35208850
Hi Chris,

That sounds brilliant! I will have to check it when i get home. and I will get back to you tomorrow.

thanks again
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35208937
Can you consider:

where in DOS do you want the messages posting ... and do you want to keep a representative folder structure under your root dos folder.

SO I can start to put some specific code for the solution together?

Chris
0
 

Author Comment

by:kdonnelly81
ID: 35209089
Hi Chris,

Can we post the message to a root folder say C:\EXMAIL. and keep yes keep a representative folder structure under your root dos folder.

Thanks Chris!!!!
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35209300
Will the account from which to export be the default account?

Where do you want to export from ... which sub folders of the account?

Chris
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 35209950
Assuming the test works then replace that sub above with this lot ... which will save everything in the inbox for the default PST.  We can scale it out if you prefer but this will show the idea anyway

Chris
Option Explicit
Dim fso As Object

Sub Q_26908386()
Const strRootDir As String = "C:\EXMAIL"
Dim fldr As Object
    
    Set fso = CreateObject("scripting.filesystemobject")
    Q_26908386_recur Application.Session.GetDefaultFolder(olFolderinbox), strRootDir
'    For Each fldr In Application.Session.folders
'        Q_26908386_recur fldr, strRootDir
'    Next
    Set fso = Nothing

End Sub

Sub Q_26908386_recur(fldr As Folder, DOSFolderPath As String)
Dim subFldr As Object
Dim mai As Object

    'Do the root export
    If fldr.DefaultItemType = olMailItem Then
        navtoDosFolder DOSFolderPath, True
        For Each mai In fldr.items
            If mai.Class = olMail Then
                If mai.Subject = "" Then
                ElseIf mai.BodyFormat = olFormatHTML Then
                    mai.saveas getSaveName(DOSFolderPath & "\" & FileNameCharsOnly(mai.Subject) & ".htm"), olHTML
                ElseIf mai.BodyFormat = olFormatRichText Then
                    mai.saveas getSaveName(DOSFolderPath & "\" & FileNameCharsOnly(mai.Subject) & ".rtf"), olRTF
                Else
                    mai.saveas getSaveName(DOSFolderPath & "\" & FileNameCharsOnly(mai.Subject) & ".msg"), olMsg
                End If
            End If
        Next
    End If
    'Do the recursion
    For Each subFldr In fldr.folders
        Q_26908386_recur subFldr, DOSFolderPath & "\" & FileNameCharsOnly(subFldr.name)
    Next

End Sub

Function FileNameCharsOnly(str As String) As String
Dim regEx As Object
Dim matches As Object
Dim arr() As String
Dim cnt As Integer
Dim dirColon As Boolean
    
    dirColon = Mid(str, 2, 1) = ":"
    Set regEx = CreateObject("vbscript.regexp")
    With regEx
        .Global = True
        .IgnoreCase = True
        .Pattern = "[^A-Za-z0-9$ %'\-_@~`\(\)\+\\,;=\[\]§-ÿ]"
    End With
    FileNameCharsOnly = regEx.Replace(str, " ")
    regEx.Pattern = " {2,}"
    FileNameCharsOnly = regEx.Replace(FileNameCharsOnly, " ")
    'If dirColon Then FileNameCharsOnly = Replace(FileNameCharsOnly, " ", ":", 1, 1)

End Function

Function navtoDosFolder(dosPath As String, Optional createFolders As Boolean) As Boolean
Dim fldrs() As String
Dim rootdir As String
Dim fldrIndex As Integer
    
    navtoDosFolder = True
    If VBA.Right(dosPath, 1) = "\" Then dosPath = VBA.Left(dosPath, Len(dosPath) - 1)
    If Len(dosPath) = 0 Then
        navtoDosFolder = False
        Exit Function
    End If
    fldrs = Split(dosPath, "\")
    rootdir = fldrs(0)
    If Dir(rootdir, vbDirectory) = "" Then
        navtoDosFolder = False
        Exit Function
    End If
    For fldrIndex = 1 To UBound(fldrs)
        rootdir = rootdir & "\" & fldrs(fldrIndex)
        If Dir(rootdir, vbDirectory) = "" Then
            If createFolders Then
                MkDir (rootdir)
            Else
                navtoDosFolder = False
            End If
        End If
    Next
End Function

Function getSaveName(strDosNameandPath) As String
Dim fn As String
Dim ft As String
Dim intIncrement As Integer

    fn = Left(strDosNameandPath, InStrRev(strDosNameandPath, ".") - 1)
    ft = Right(strDosNameandPath, Len(strDosNameandPath) - InStrRev(strDosNameandPath, ".") + 1)
        Do While fso.FileExists(fn & "_" & intIncrement & ft)
            intIncrement = intIncrement + 1
        Loop
        getSaveName = fn & "_" & intIncrement & ft

End Function

Open in new window

0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question