harryhoudini66
Technical User
Hello,
I have a script I am using (thanks to Skip) for sending out a report daily. I now need assistance with the monthly report. The report will be sent out the first of the month and I would like the subject line to referance the prior month. Here is what I have currently. What do I need to change to have it enter the prior month automatically?
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
objMailItem.Display
strEmailAddr = "recipient@e-mail.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Subject = "Prior Month Totals for "& Date-1
objMailItem.HTMLBody = "Attached is the prior month report."
objMailItem.Attachments.Add "\\fileserver2\PriorMonthReport.xlsx"
objMailItem.Display
Set objMailItem = nothing
Set objOutl = nothing
I have a script I am using (thanks to Skip) for sending out a report daily. I now need assistance with the monthly report. The report will be sent out the first of the month and I would like the subject line to referance the prior month. Here is what I have currently. What do I need to change to have it enter the prior month automatically?
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
objMailItem.Display
strEmailAddr = "recipient@e-mail.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Subject = "Prior Month Totals for "& Date-1
objMailItem.HTMLBody = "Attached is the prior month report."
objMailItem.Attachments.Add "\\fileserver2\PriorMonthReport.xlsx"
objMailItem.Display
Set objMailItem = nothing
Set objOutl = nothing