I would like to let my script do the naming of the PDF files it generate. It work but when I want to attach the files in e-mails using the Outlook module, I need a solution for reading the file extension (PDF) in the filename.
When I run the script can read the filename but it can’t read the file extension.
okay so as I understand you want to attach a file in email and in send outlook mail message activity…but where are you getting the file from?
ideally if you are trying to get the file from local computer then it would be uisng the path.if you have a folder we can try to get the files from there using Directory.Getfiles function…
The script line I show you, can by “FName” (column name in Excel sheet) read the filename from the PDF in the folder but to attach the file it need the extension too. Here I get the trouble.
if there are only filenames written in excel file and you know that each file would of type .pdf, you can add .pdf while attaching the file at the end.
Or else if you’re creating this excel somehow, please use FullPath while inserting data into excel.
12:23 26-07-2023 - Script read name, birthday and e-mail from Excel file, generate a Word file and save it as a PDF, which are going to be send to the e-mail read from the Excel file.
1.1 Single Excel Process Scope (SequenceX)
Private = False
Variables
Notes(IWorkbookQuickHandle)
Destination_Folder(String)
Source_Folder(String)
Activities
1.6 Move files and Folder from one location to another (Sequence)
Private = False
Activities
1.50 Enter Source Folder location (Assign)
To variable = Destination_Folder
Set value = string.Format("C:\Users\hm-hy\OneDrive\Dokumenter\UiPath\MoveFileAndFolders1")
Private = False
1.45 Enter Destination Folder (Assign)
To variable = Destination_Folder
Set value = string.Format(“C:\Users\hm-hy\OneDrive\Dokumenter\UiPath\MoveFileAndFolders1")
Private = False
1.26 Move all the files to new location (ForEachFileX)
In folder = string.Format(”{0}", System.IO.Directory.GetCurrentDirectory())
IncludeSubdirectories = False
Skip folders where access is denied = False
Filter = *.pdf
Order = NameAscFirst
Private = False
Body
1.27 Do (Sequence)
Private = False
Activities
1.28 Move File (MoveFile)
Path = Source1
Destination = Target1
Overwrite = True
Private = False
1.7 Move all the folders to new location (ForEachFolderX)
In folder = System.IO.Path.GetFullPath(Source_Folder)
Include subfolders = False
Skip folders where access is denied = False
Order by = NameAscFirst
Private = False
Body
1.8 Do (Sequence)
Private = False
Activities
1.9 Move Folder (MoveFolderX)
From = CurrentFolder.FullName
To = System.IO.Path.GetFullPath(Destination_Folder)
Overwrite = False
Private = False