我想通过使用excel vba发送邮件(需要在主题中放置日期),从当天起减去2天
答案 0 :(得分:0)
您可以使用MailItem类的Subject属性,该属性允许获取或设置指示Outlook项目主题的字符串。
How to automate Outlook from another program文章解释了自动化Outlook所需的所有步骤。
答案 1 :(得分:0)
你可以这样做。
Option Explicit
Sub AddDate()
Dim olApp As Object
Dim olMail As Object
Dim SubjectDate As String
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
SubjectDate = Format(Now - 2, "Long Date")
' OR
' "Short Date"
' "DD/MM/YYYY"
'
With olMail
.Subject = SubjectDate
.Display
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub