|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
我是想自动保存outlook附件从excel去CSV格式。下面是我写的code
Public Sub saveAttachtoDisk2(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim saveFolder1 As String
Dim dateFormat
dateFormat = Format(itm.ReceivedTime, "mmddHH")
Dim pathname As String
saveFolder = "D:\AEPO\"
'saveFolder1 = "N:\Auto_PO"
For Each objAtt In itm.Attachments
' objAtt.SaveAsFile saveFolder & "\" & dateFormat & "_" & objAtt.DisplayName
objAtt.SaveAsFile saveFolder & "\" & dateFormat & "_AgilentOpenPOReport.csv"
objAtt.SaveAsFile saveFolder & "\" & "LatestOpenPOReport.xls"
objAtt.SaveAsFile saveFolder1 & "\" & dateFormat & "_AgilentOpenPOReport.csv"
Set objAtt = Nothing
Next
End Sub |
|