我有一个VBS,每天通过outlook向用户发送excel表。但有些日子,excel将是空的,所以我不想发送excel表,而是发送消息,例如"没有找到记录"或类似的东西。 我目前的VBS脚本如下 -
const cdoBasic=0
schema = "http://schemas.microsoft.com/cdo/configuration/"
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "xyz@abc.com"
.To = "abc@123.com"
.CC = "akcg@h.com"
.Subject = "Report (Daily Tracking)"
.Textbody = "blah blah blah"
.AddAttachment "F:\\Monitor_Output\\report.xls"
With .Configuration.Fields
.Item (schema & "sendusing") = 2
.Item (schema & "smtpserver") = "mail.xxxx.corp"
.Item (schema & "smtpauthenticate") = cdoBasic
End With
.Configuration.Fields.Update
.Send
End With
有关如何修改此信息并仅发送消息而不是整个Excel工作表的任何帮助吗?
谢谢, 阿伦