I am trying to save a PDF with the Name and DateTime details in a filename.
To do this I am saving an email into PDF and writing the filename with using the “Type into” activity but I am having some trouble writing the variable with the filename. It only seems to like fixed text. I am just trying to write the Date Time in the example below.
My Variable is being represented as “” when it is not actually blank (as supported by the write line activity).
My workflow looks like is taken from: 1. Within For Each Activity for Outlook emails
Could you please try same process like you are doing .eml to pdf so try to save email as pdf those steps for manually by hand and check that time file name is coming or not
Solution 1: I am adding an extra step where I use a “Move File” activity where I move the file back to the same location but with a new filename which is a working solution.
Its not my preferred method as I would prefer to type all in one step as less steps are better.
Solution 2: The “Type Into” activity appears to be working now BUT only when I choose a new folder…
So i have selected one folder further down called processed. I should be able to save to the same folder. This has resolved it.
The destination folder looks something like this: PDF\Processed" + str_Name +" " + Str_DateTimeFileName + “.pdf”
I hate Regex. This one item.Headers(“Date”) looks like a DateTime, but you will probably get it as an Object. You need simply to convert it into a DateTime first, then into a string with proper file-compatible format:
dReceived = CType(mail.Headers(“Date”).ToString , DateTime)
Str_DateTimeCLEAN =dReceived.ToString(“dd-MM-yyyy HH.mm.ss”)