-
How to save attachments and move email using Rules
Hi,
I've tried creating a rule that runs a script every time an email is sent to a email distribution.
For some reason, the rule does not save the attachments. Can someone please help?!
Sub attachmentrule(item As Outlook.MailItem)
Dim atmt As Attachment
Dim i As Integer
If item.Attachments.Count > 0 Then
For i = 1 To item.Attachments.Count
If Right(atmt.FileName, 3) = "xls" Then
FileName = "T:\Operations\Excel Attachments\" & Format(item.ReceivedTime, "yyyymmdd_hhnnss_") & atmt.FileName
atmt.SaveAsFile FileName
End If
Next
End If
Set atmt = Nothing
End Sub
-
Hi djchou,
Welcome to the board
We already have a thread ongoing on this:
http://www.vbaexpress.com/forum/showthread.php?t=15438
Cordially,
Aaron
Keep Our Board Clean! - Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
- Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules