I have a folder of files with names like D0000025667-T04292.pdf, D0000025668-T02119.pdf, D0000025670-T01125.pdf
and so on.
I have an MS access database table, with values as follows:
**Dealer Code Email**
T04292 a@gmail.com
T04292 a@gmail.com
T02119 b@gmail.com
T01125 b@gmail.com
RS0009 c@gmail.com
RS0001 c@gmail.com
C01020 d@gmail.com
I need to get the 'For Dealer' code from the table and search in folder. Finally I need to attach matching files to an email to send to the address listed in the database e.g. Dealer Code T04292
matches file D0000025667-T04292.pdf
which needs to be sent to a@gmail.com
.
I have one mail function where I can directly specify the attaching file path, but now I need to search and match the files need to attach.