I've been trying to access folders and items in my Outlook archive using exchangelib.
I can print out the tree structure in the account with print(account.root.tree())
and iterate over the messages with:
for item in account.root.all().order_by('-datetime_received')[:10]:
print(item.subject, item.body, item.attachments)
..but how can I achieve the same in my archive?
print(account.archive_msg_folder_root.tree())
does not return an equivalent tree-structure, and I cannot find a way to traverse the folder structure in my archive and access the messages' information in a given subfolder.
EDIT:
I should clarify. This is my folder structure in my outlook: The archive I am trying to access
I have my regular inbox and different folders, and an archive ("Tilkoblet arkiv - <myuser@domain.no>
"), where items more than 3 months are moved to. I am trying to access these older items. Is archive_msg_folder_root
the right way to go? Or do I need to change the primary_smtp_address?