我有一个 MS Access 数据库,我想在其中调用一个函数,该函数在字符串中包含今天的日期,如下所示。我正在尝试将今天的日期放在将要创建的新电子邮件的主题行和电子邮件正文中。有什么想法可以实现这一目标吗?
Private Sub Command_Click()
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim ThisDay As Date
ThisDay = Format(Now, "mm/dd/yy")
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = ""
.CC = ""
.Subject = "Daily Email Processed " *(Thisday)
.Body = "Hi," + vbNewLine + vbNewLine + vbNewLine + "Please find below the number of Emails processed for the " + vbNewLine + vbNewLine + "Email Count = " + vbNewLine + "O Count = "
.Attachments.Add ""
.Attachments.Add ""
.Display
End With
Set objOutlook = Nothing
End Sub