I want to iterate through the files in a given folder in Enterprise Connect to check, if file exists, delete or add files.
I am able to access the folders, but can't iterate through the items:
Sub IterateEnterpriseConnect()
Dim FP As MAPIFolder
Dim folder As MAPIFolder
Set FP = Application.GetNamespace("MAPI").Folders("Enterprise Connect").Folders("FolderName1").Folders("FolderName2").Folders("FolderName3").Folders("FolderName4").Folders("FolderName5")
MsgBox FP.Name
For Each Elem In FP.Items
MsgBox Elem.Name
Next
End Sub
MsgBox. FP.Name returns the expected Name of the selected folder, but while there a numerous pdf-files in the folder FP.Items seems to be empty.
Any idea how i can access or iterate the items in the folder?