我想做的只是在下面的代码中在 VBA 中设置一个日期变量。但是,如果我尝试使用 mydate = date,它就不起作用:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim mydate As String
mydate = date
saveFolder = "T:\EC Portfolio Reports\CCA Credit Europe\ctpty"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & mydate & objAtt.FileName
Set objAtt = Nothing
Next
End Sub