Hi Jim,I'm a beginner ,if you have problem about this, you can contact me by email:
[email protected]
Sub exportMail()
'µ¼³öÓʼþΪexcel
'export mail in outlook to excel
Dim myOlApp As New Outlook.Application
Dim myMails As Object
Dim myMail As Object
Dim myNamespace As Outlook.NameSpace
Dim xlApp As New Excel.Application
Dim xlBook As Excel.Workbook
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myMails = myNamespace.GetDefaultFolder(olFolderInbox).Items
Set xlBook = xlApp.Workbooks.Add
'For Each myMail In myMails
xlBook.Sheets(1).Cells(1, 1).Value = myMails(myMails.Count).Body
xlApp.Visible = False
'myMails(myMails.Count) is your latest mail,if you want get all of your mails,you can use "for each myMail in myMails ¡*¡* next"
'and you need add some code by yourself , this function will slow down your speed.
' Next
xlBook.SaveAs fileName:="d:\mail.xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
xlBook.Close
xlApp.Quit
Set myNamespace = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
Set myMails = Nothing
Set myOlApp = Nothing
End Sub