使用自定义日期格式自动填充 Outlook 主题

Auto populate outlook subject with custom date format

有没有办法让outlook自动填写新邮件的主题格式yyyymmdd?我尝试使用自定义表单并将主题值设置为 Date() 但这给出了错误的格式。 我正在使用 Microsoft Office 365 桌面应用程序。

例如,新电子邮件的主题 20210511 会自动填写

非常感谢任何帮助!

您可以开发一个 VBA 宏来完成这项工作。例如,您可以处理 Outlook 项目的 NewInspector event is fired whenever a new inspector window is opened, either as a result of user action or through program code. So, when a new email is created you can add or modify the subject line (see the Subject 属性。

例如,以下示例创建一个新的电子邮件消息,使用 Add 方法将“Eugene Astafiev”添加为 To 收件人,设置 Subject 属性,然后显示消息:

Sub CreateStatusReportToBoss() 
 Dim myItem As Outlook.MailItem 
 Dim myRecipient As Outlook.Recipient 
 
 Set myItem = Application.CreateItem(olMailItem) 
 Set myRecipient = myItem.Recipients.Add("Eugene Astafiev") 
 myItem.Subject = "Status Subject" 
 myItem.Display 
End Sub