DumboFixer
02-15-2006, 02:54 AM
Hi,
This has probably been asked before - if it has then my apologies.
We're trying to scan a folder in outlook and process each email in turn. That bit we can do but after a while we get a type mismatch error.
This code snippet reporduced the problem.
Dim oMail As Outlook.MailItem
Dim counter1 As Integer
Sub VL_PCP_error_report()
counter1 = 0
Set CurFolder = ActiveExplorer.CurrentFolder
Set AllItems = CurFolder.Items
Debug.Print ActiveExplorer.CurrentFolder
For Each oMail In AllItems
counter1 = counter1 + 1
Debug.Print counter1
Next
End Sub
It will loop a number of times then generate the mismatch error.
Any ideas whats going wrong (and how we get round it) ?
There are over 1000 emails in the folder but it's going wrong at number 965 (not that I think that's relevant). Each email is around 20K.
I've also seen it in folders containing a few hundred emails.
This has probably been asked before - if it has then my apologies.
We're trying to scan a folder in outlook and process each email in turn. That bit we can do but after a while we get a type mismatch error.
This code snippet reporduced the problem.
Dim oMail As Outlook.MailItem
Dim counter1 As Integer
Sub VL_PCP_error_report()
counter1 = 0
Set CurFolder = ActiveExplorer.CurrentFolder
Set AllItems = CurFolder.Items
Debug.Print ActiveExplorer.CurrentFolder
For Each oMail In AllItems
counter1 = counter1 + 1
Debug.Print counter1
Next
End Sub
It will loop a number of times then generate the mismatch error.
Any ideas whats going wrong (and how we get round it) ?
There are over 1000 emails in the folder but it's going wrong at number 965 (not that I think that's relevant). Each email is around 20K.
I've also seen it in folders containing a few hundred emails.