![]() |
|
#1
|
|||
|
|||
|
I found the following code could someone explain what it is doing. I am trying to save all the attachments in an email folder to a location on my hard drive then move the email and the attachment to a subfolder. I'm trying to do this is in Outlook 2016. I dont understand the MailItem Object very well. Thank you in advance. --Walker
Code:
For Each Item In olSubFolder.Items
For Each Attachment In Item.Attachments
If Attachment.Type = 1 And (InStr(Attachment, "xlsx") Or InStr(Attachment, "xls")) > 0 Then
FileName = networkFilepath & Attachment.FileName
'Debug.Print FileName
Debug.Print Attachment.FileName
' Debug.Print Item
Attachment.SaveAsFile FileName
End If
Next Attachment
Next Item
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Image and it's explanation need to stay together
|
mohsen.amiri | Drawing and Graphics | 2 | 10-04-2017 04:10 AM |
Explanation for this formula
|
Will | Excel | 7 | 11-26-2014 05:27 PM |
| Cannot access most of property of MailItem object on Windows Server 2008 64 bit | tz900 | Outlook | 0 | 04-10-2012 12:55 PM |
Explanation for fields on the form
|
hklein | Word VBA | 5 | 10-23-2011 04:10 AM |
| MailItem Inspectors cache CommandBars but Calendar do not? | Hydrogen | Outlook | 0 | 03-04-2006 09:50 PM |