Below is the macro I am using. Basiclly what it does is once we complete our last worksheet (report) we press a send button which opens up outlook and attaches all of the files that need to be sent. what i would like the macro to do is reconize the the files with the most rescent date.
For example each week we complete a thermostat report, and we name it
"thermostat mm.dd". Each week the mm.dd changes. Not sure if this is even possible.
Sub Mail_workbook_Outlook_1()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "gm307"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
.Attachments.Add "C:\Documents and Settings\manager\Desktop\Thursday\ALD Report1.0.xls"
.Attachments.Add "C:\Documents and Settings\manager\Desktop\Thursday\thermostats.xls"
.Attachments.Add "C:\Documents and Settings\manager\Desktop\Thursday\weekly wci with spoilage.xls"
.Attachments.Add "C:\Documents and Settings\manager\Desktop\Thursday\lift inspection.doc"
.Attachments.Add "C:\Documents and Settings\manager\Desktop\Thursday\seat inspections.doc"
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub