求助:如何自动保存某一个特定的邮件到某一个文件夹里
outlook 2010
如题, 想让计算机自动保存某一个或者是某几个联系人的邮件中的附件(名称不改)到某一个文件夹里,省得要时不时的刷新,看有没有收到邮件 VBA 怎么实现?
[解决办法]
你的需求通过规则+VBA实现。
Public Sub SaveAttach(Item As Outlook.MailItem)
SaveAttachment Item, "D:"
' MsgBox "???tò?±£′?"
End Sub
' ±£′????t
' path?a±£′??·??£?condition?a???t???¥??ì??t
Private Sub SaveAttachment(ByVal Item As Object, path$, Optional condition$ = "*")
Dim olAtt As Attachment
Dim i As Integer
If Item.Attachments.count > 0 Then
For i = 1 To Item.Attachments.count
Set olAtt = Item.Attachments(i)
' save the attachment
If olAtt.FileName Like condition Then
olAtt.SaveAsFile path & olAtt.FileName
End If
Next
End If
Set olAtt = Nothing
End Sub