G
Guest
I have a .rtf documents that may or may not be updated daily. If it was
updated today then it needs to be added to an email to be sent out. If not,
the .rft document is not sent. Is there code i can put in excel that will
look at the modified date for a specific file, check to see if that file date
equals todays, and if it does, attack it to an email.
Here is the code i currently use for the email:
Sub Mail_workbook_Outlook()
Windows("CSTS Rollup.xls").Activate
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "Distro"
.CC = ""
.BCC = ""
.Subject = "Daily/MTD CSTS Rollup as of " & Format(Date, "mm_dd_yy")
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.Display
.ReadReceiptRequested = False
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
ActiveWindow.Close
End Sub
updated today then it needs to be added to an email to be sent out. If not,
the .rft document is not sent. Is there code i can put in excel that will
look at the modified date for a specific file, check to see if that file date
equals todays, and if it does, attack it to an email.
Here is the code i currently use for the email:
Sub Mail_workbook_Outlook()
Windows("CSTS Rollup.xls").Activate
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "Distro"
.CC = ""
.BCC = ""
.Subject = "Daily/MTD CSTS Rollup as of " & Format(Date, "mm_dd_yy")
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.Display
.ReadReceiptRequested = False
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
ActiveWindow.Close
End Sub