Hey all,
Quick run down of what I am trying to do. Every day we get some new files sent to us via attachments. I am trying to take these attachments and place them in a folder so that we can insert them into Excel document. I have the excel side figured out and the saving the attachements figured out, but I can not figure out how to make it only grab the attachemtns that do not already exists in the directory I am saving them to. Anyone have any ideas as to how I can do this? Here is what I have so far.
Sub SaveAttachments()
Dim myOlapp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myItem As Outlook.MailItem
Dim myAttachment As Outlook.Attachment
Set myOlapp = CreateObject("Outlook.Application")
Set myNameSpace = myOlapp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myFolder = myFolder.Folders("000")
For Each myItem In myFolder.Items
If myItem.Attachments.Count <> 0 Then
For Each myAttachment In myItem.Attachments
myAttachment.SaveAsFile "C:\Attachments\" & myAttachment & ".htm"
Next
End If
Next
End Sub