Hallo!
Ich verwende folgenden Code um vom Standardpostfach einen Unterordner auszulesen.
Da ich jetzt mehrere Postfächer habe wollte ich fragen, wie ich dies von einem anderen "nicht Standard Postfach" durchführen kann.
Set ol = New Outlook.Application
Set olNs = ol.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox).Folders("postfach_standard").Folders("Unterordner")
Danke für eine Antwort
Schau dir mal das Namespace-Objekt im Objektkatalog genauer an.
Das hat die Folders- und die Accounts-Auflistungen, die beide zum Ziel führen können, je nachdem welche Informationen du hast, um das gesuchte Postfach zu identifizieren.
Danke konnte eine Lösung finden:
For Each olNs In ol.GetNamespace("Mapi").Folders
If olNs.Name = "Postfach" Then
Set olSubVerz1 = olNs
Exit For
End If
Next olNs
If Not olSubVerz1 Is Nothing Then
For Each olNs In olSubVerz1.Folders
If olNs.Name = "Posteingang" Then
Set olSubVerz2 = olNs
Exit For
End If
Next olNs
End If
If Not olSubVerz2 Is Nothing Then
For Each olNs In olSubVerz2.Folders
If olNs.Name = "Unterordner" Then
Set olSubVerz2 = olNs
Exit For
End If
Next olNs
End If
Danke für den Hinweis