How to attach excel file from path in in out look with current date

how to attach excel file from path in in out look with current date

kindly let me know on this any example would be helpful

Hi @T_Y_Raju ,

  1. Get Current Date :

currentDate.ToString(“yyyyMMdd”)

image

  1. Compose File Path:

    Concatenate the file path with the formatted date to create the full file path of the Excel file.

path.GetFileNameWithoutExtension(filePath).ToString + “_” + currentdate + Path.GetExtension(filePath).ToString

3.rename the file with new file path or copy the file to new file path

image

  1. Send Outlook Email :

    Use the Send Outlook Mail Message activity to send an email.

    • Fill in the necessary fields like To, Subject, and Body.
    • For the Attachments field, provide the newFilepath` variable.

Thanks ,

Can you provide more detail? What do you mean with current date? Does the filename already contain the current date? You’re trying to rename the file then attach it? We need specific details in order to help.

There’s no reason to create a variable to assign the current date to. Just put it in the expression.

path.GetFileNameWithoutExtension(filePath).ToString + “_” + Now.ToString(“yyyyMMdd”) + Path.GetExtension(filePath).ToString