Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Dec 23, 2021
Solved

Print Report to PDF and append Date to file name

Hello, I want to add a date in YYYYMMDD format to the file name below.  I cant seem to get it to work.   the file name should be Pending 20211223.pdf the below code is not correct (bold part)   P...
  • arnel_gp's avatar
    Dec 23, 2021
    you can Format$() the Date/Time:

    "C:\Users\Me\OneDrive\Documents\" & "Pending" + Format$(Now(), "yyyymmdd") & ".pdf"