Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

How to export outlook mail to folder on my PC

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
kdonnelly81
Asked:
kdonnelly81
  • 7
  • 7
  • 2
  • +2
1 Solution
 
Michael_MCDSTCommented:
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
 
MicMaticCommented:
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
 
kdonnelly81Author Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
kdonnelly81Author Commented:
PS Sorry I didn't make that bit clear in my first post!!
0
 
Jackie ManCommented:
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
 
Chris BottomleyCommented:
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
 
kdonnelly81Author Commented:
Hi jackieman,

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

Ps Any other ideas would be greatly appreciated.
0
 
Jackie ManCommented:
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
 
Chris BottomleyCommented:
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
 
kdonnelly81Author Commented:
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
 
Chris BottomleyCommented:
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
 
kdonnelly81Author Commented:
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
 
Chris BottomleyCommented:
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
 
kdonnelly81Author Commented:
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
 
Chris BottomleyCommented:
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
 
kdonnelly81Author Commented:
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
 
Chris BottomleyCommented:
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
 
Chris BottomleyCommented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 7
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now