I currently have this code to open an email and fill in the To, Subject, Cc, and Body.
I have some files each day that I want to be attached to this email. They have a date in the file name. Example: "very secret-Nov-02 stuff.pdf" The date will always be yesterday's date, so tomorrow "Nov-03" will be in the file name. I need some code that will identify any file that has yesterday's date. I can read code and generally understand what it does, but I cannot write it. (Not yet, at least) I could use anyone's help that is willing, and I could learn a little bit in the process.
Code:
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
objMailItem.Display
strEmailAddr = "mike@*********.com"; "john@********.com"; "xeeq@*******.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Body = "Hey, how's it going?"
objMailItem.Subject = "Whhat's up?"
objMailItem.Cc = "more emails"
strAttachment = "More code required before I can put anything here."
objMailItem.Attachments.Add strAttachment
Set objMailItem = nothing
Set objOutl = nothing
I have some files each day that I want to be attached to this email. They have a date in the file name. Example: "very secret-Nov-02 stuff.pdf" The date will always be yesterday's date, so tomorrow "Nov-03" will be in the file name. I need some code that will identify any file that has yesterday's date. I can read code and generally understand what it does, but I cannot write it. (Not yet, at least) I could use anyone's help that is willing, and I could learn a little bit in the process.