Apologies Chris I'll try to explain a bit more.
I don't know a grreat deal about the servers themselves, but what I can say is that the following code works in a current MS Access application we have.
Obviously I need to convert this to VB.NET.
Code:
For Each mailbox In Mailboxes
lblMessage.Caption = "Checking " & mailbox & " mailbox, please wait..."
Set myRecipient = myNamespace.CreateRecipient(mailbox)
myRecipient.Resolve
If myRecipient.Resolved Then
Set Inbox = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderInbox)
Set ProcessedFolder = Inbox.folders.GetFirst
Do Until InStr(1, ProcessedFolder.Name, "Processed") <> 0
Set ProcessedFolder = Inbox.folders.GetNext
If ProcessedFolder Is Nothing Then
MsgBox "Unable to open Processed folder for " & UCase(mailbox), vbCritical, "Daily Checks"
Exit Sub
End If
Loop
Set item = ProcessedFolder.Items.GetFirst
Else
MsgBox "Unable to open " & UCase(mailbox) & " mailbox. Check manually.", vbExclamation, "Daily Checks"
End If
If InStr(1, LCase(mailbox), "zurich") <> 0 Then
[Last ABC File Received] = Format(item.SentOn, "Short Date")
ElseIf InStr(1, LCase(mailbox), "ABC") <> 0 Then
[Last DEF File Received] = Format(item.SentOn, "Short Date")
ElseIf InStr(1, LCase(mailbox), "DEF") <> 0 Then
[Last GHI File Received] = Format(item.SentOn, "Short Date")
ElseIf InStr(1, LCase(mailbox), "GHI") <> 0 Then
[Last JKL File Received] = Format(item.SentOn, "Short Date")
ElseIf InStr(1, LCase(mailbox), "JKL") <> 0 Then
[Last MNO File Received] = Format(item.SentOn, "Short Date")
ElseIf InStr(1, LCase(mailbox), "MNO") <> 0 Then
[Last PQR File Received] = Format(item.SentOn, "Short Date")
End If
Next mailbox