Looping through mailbox file - WeOnlyDo Discussion board

Looping through mailbox file (wodWebServer / wodWebServer.NET)

by Joey, Monday, March 16, 2009, 03:32 (5730 days ago)

I'm trying to insert a header into about 2300 messages. This is a Thunderbird folder. VB keeps crashing, Outlook also. Is it my code or limitations of WodMailbox?
[code]Sub InsertMessageIdHeader()

Dim oMailbox As wodMailboxCom
Set oMailbox = New wodMailboxCom
oMailbox.FileName = C:TestSent
oMailbox.Lock

For Each oMessage In oMailbox.Messages
If oMessage.Headers.Exists( Date ) And _
Not oMessage.Headers.Exists( Message-Id ) Then
oMessage.Headers.Add Message-Id , oMessage.Headers( Date )
End If
Next oMessage
oMailbox.Update
oMailbox.Unlock

End Sub[/code]


Complete thread: