Hello,
I wrote a tool which read an outlook folder and save the mails to the hard
disk (in .msg files)
Here below one of the main sub of my tool.
I don't know why but sometimes, this software 'forget' one or a few mails
....
For instance : 24 mails in the folder but only 22 are saved.
Any idea ?
Thanks a lot
__________________________________________________ ______________________
Public Sub save_mails(Optional PathName As String)
Dim oOutlook As Outlook.Application
Dim oNs As Outlook.NameSpace
Dim oFldr As Outlook.MAPIFolder
Dim oMessage As Object
Dim sPathName As String
On Error Resume Next
Set oOutlook = New Outlook.Application
Set oNs = oOutlook.GetNamespace("MAPI")
Set oFldr = oNs.GetDefaultFolder(olFolderInbox)
Set selected_Fldr = oFldr.Folders(List1.Text)
For Each oMessage In selected_Fldr.Items
oMessage.SaveAs sPathName & nomfichier$ & ".msg", olMSG
Next
Set oMessage = Nothing
Set oFldr = Nothing
Set oNs = Nothing
Set oOutlook = Nothing
End Sub