How to save my emails on a disk

  • Thread starter Thread starter galsaba
  • Start date Start date
galsaba said:
How I can save all my emails on disk.
I have thousands of emails.

Thanks,

Galsaba

Hi,
please search your *.pst File. It included all your mails.
You can save this file on a disk, but you have to use outlook to open the
pst file if you want to read your mails after storing on the cd.
the default path is C:\Documents and Settings\[username]\Local
Settings\Application Data\Microsoft\Outlook
It is a hidden folder, so please be sure that you have activat "show hidden
files and folders" in the windows explorer options.
 
Well would you like to save them in msg extension? If so pop this VBA code in the ThisOutlookSession class.

Sub ExportOutlookMessagesToDisk()
Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim cf As Outlook.MAPIFolder
Dim Prop As Outlook.UserProperty
Dim sMsg As Outlook.MailItem
Dim oAtt As Outlook.Attachment
Dim iMsgCnt As Integer
Dim iAttachCnt As Integer
Dim iRnd As Long
Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olFolderInbox) ' olFolderInbox)
Randomize
iMsgCnt = 0
For Each sMsg In cf.Items
sMsg.SaveAs "C:\hold\" & sMsg.Subject & ".msg"
'sMsg.Subject
'With sMsg.Attachments
' iAttachCnt = sMsg.Attachments.Count
' If iAttachCnt > 0 Then
' For Each oAtt In sMsg.Attachments
' oAtt.SaveAsFile "C:\hold\Attachments\" & Mid(CStr(Rnd), 3) & "_" & oAtt.FileName
' Next
' End If
iMsgCnt = iMsgCnt + 1
Next
End Sub

Then you run this Macro.
 
Back
Top