I have automated excel reports that generate each day and are placed in a specific folder on my network. I have a VBScript that I use to email these reports automatically. The files names are the names of the users who get the report with the exception there is a random number as part of the file name. So the file name changes partially each day. How can I add a wildcard script to attach the file based only on the user name in the file name? My current script is only looking for a specific file name. Here is my script.
Set objMessage = CreateObject("CDO.Message")
HTMLMessage = "Reports Attached"
objMessage.Subject = "XXX Reports"
'objMessage.Sender = "John Doe"
objMessage.From = "Doe"
objMessage.To = "email@example.com"
objMessage.HTMLBody = HTMLMessage