As described in another blogpost: Establish a connection with Outlook first:
Next, we will have to create a local folder and create a variable with the path to this folder:
We have to select a folder from Outlook. The rest of the script will go through every mail from this folder and download the attachments. It is important to have Outlook running and being able to select a folder.
Finally we can download all the attachements.
You can find the code in this Github repository.