I am trying to robotise a proces, but i haven’t succeeded yet.
I hope you guys can help me!
The process goes as follows:
In Outlook, we get an email with two kinds invoices (PDF). The invoice that starts with Invoice_100XXX and Invoice_200XXX.
The enclosed pdf invoices must be stored in an folder called “2019”. This step must be dynamic. In 2020, there will be made another folder with the year 2020.
Inside this folder, there are two folders: Invoice_100 and Invoice_200.
Thereafter, there has to be made a folder. The name of this folder must be the date of today (example: 01-01-2019). If this folder already exist, then this part can be skipped.
The invoices 100 and 200 must be divided and moved to the 100 or 200 folder.
So in summary: Folder 2019 → Divide → Create folder in 100 or 200 folder (date of today) → move the invoices.
This is very easy to do. Please attend the foundation course and you would be able to do it.
If you have any specific issue or if you are stuck at some point, we can definitely help.
What i have done so far is, storing the attachements to a folder called attachements.
The trick now is to divide the Invoice_500xxx and Invoice_100 files to the right folder. (Year → 500 or 100 folder → month —> date that the email was sent)
I hope you can help me figuring this out, because i can’t
Loop each file in the attachment folder. For each file in the folder get the creation date of the file.
Get the year from creation date and store in variable Current_year. Now you got till year in the file path (c:\Current_year) where you want to store the invoice.
Now, check whether the file name includes keyword 100 if yes then append that value to the path (c:\Current_year\100).
Get today’s date.
Check whether there is a folder already exist with today’s date in path (c:\Current_year\100).
If exist don’t create new folder just move the file to the created path by appending today’s date also (c:\Current_year\100\Today_date).