P
PJFry
I am running code that exports data releated to unread messages in an inbox.
What is puzzling me is that the code only returns half of the values that it
is supposed to. For example, if I have 50 unread messages, it will export
the data on the first 25 and stop. Any ideas what is causing this?
I am running OL 2003 on Windows XP Pro.
Sub SupplierSurvey()
With Application.Session
ExportMessageDetails .Folders("Mailbox - Quality
Department").Folders("Inbox")
End With
End Sub
Function ExportMessageDetails(vFolder As MAPIFolder) As Boolean
On Error GoTo Err_Handler
Kill "H:\SupplierSurvey.txt"
Dim vItem As Object, vFF As Long, vFile As String
vFF = FreeFile
vFile = "H:\SupplierSurvey.txt"
For Each vItem In vFolder.Items
If TypeName(vItem) = "MailItem" Then
If vItem.UnRead Then
Open vFile For Append As #vFF
Print #vFF, vFolder.Name & vbTab &
Format(vItem.ReceivedTime, "mm/dd/yyyy hh:mm:ss")
Close #vFF
End If
End If
Next
Err_Handler:
Resume Next
End Function
Thanks!
PJ
What is puzzling me is that the code only returns half of the values that it
is supposed to. For example, if I have 50 unread messages, it will export
the data on the first 25 and stop. Any ideas what is causing this?
I am running OL 2003 on Windows XP Pro.
Sub SupplierSurvey()
With Application.Session
ExportMessageDetails .Folders("Mailbox - Quality
Department").Folders("Inbox")
End With
End Sub
Function ExportMessageDetails(vFolder As MAPIFolder) As Boolean
On Error GoTo Err_Handler
Kill "H:\SupplierSurvey.txt"
Dim vItem As Object, vFF As Long, vFile As String
vFF = FreeFile
vFile = "H:\SupplierSurvey.txt"
For Each vItem In vFolder.Items
If TypeName(vItem) = "MailItem" Then
If vItem.UnRead Then
Open vFile For Append As #vFF
Print #vFF, vFolder.Name & vbTab &
Format(vItem.ReceivedTime, "mm/dd/yyyy hh:mm:ss")
Close #vFF
End If
End If
Next
Err_Handler:
Resume Next
End Function
Thanks!
PJ