How to update file names when the file names contain specific string referenced from a table?

  • Hi Guys,

    I need some help here please!. I have a fully functional outlook macro, that downloads Outlook attachments to OneDrive specified folder. So the macro would update the file name with the email domain and month/year e.g. "comfone.com_08-2019___Invoice_GBR_Z-GRX_2019_07.pdf"

    However, I would like the macro to also have the ability to compare against a static excel table called Table.xls (2 columns where column A contain the email domain name, and column B containing its respective company code), wherein if the excel cell contains "comfone.com", then its corresponding company code say 0001 would then be appended to the file name so the file name gets updated to "0001_comfone.com_08-2019___Invoice_GBR_Z-GRX_2019_07.pdf"



    Is there any expert who could lend a hand and help me with my query please? Thanks a ton!