我正在尝试使用Outlook中的脚本和规则来自动归档附件。它有效但不使用附件的日期时间,而是使用当前日期时间。 这是我的剧本:
Public Sub saveFedhealthstatement(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim dateFormat
dateFormat = Format(Now, "yyyy-mm-dd H-mm")
Dim subject
subject = itm.subject
saveFolder = "f:\filing\fedhealth"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & subject & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub