I have several Modules set up to extract Email attachments to a file. The code is like this:
Public Function getmailZip1()
Dim myOlApp As Object
Dim myNamespace As Object
Dim MyFolder As Object
Dim myItem As Object
Dim myAttachments As Object
Set myOlApp = CreateObject("Outlook.Application"
Set myNamespace = myOlApp.GetNamespace("MAPI"
Set MyFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItem = MyFolder.Items("Zip1"
'myItem.Display
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "j:\Folder\SubFolder\" & myAttachments.Item(1).DisplayName
End Function
I get several downloads daily from an outside agency as zip files which I must export to a folder, unzip, and rename. I finally got this to work but now I need to get these messages out of my inbox and into deleted items folder with code. These downloads also arrive on weekends so I need to automate this for the weekend. Why do I need to do this because the downloads come with the same name for attachments every day. Any Ideas? I am using Access 97.
Public Function getmailZip1()
Dim myOlApp As Object
Dim myNamespace As Object
Dim MyFolder As Object
Dim myItem As Object
Dim myAttachments As Object
Set myOlApp = CreateObject("Outlook.Application"
Set myNamespace = myOlApp.GetNamespace("MAPI"
Set MyFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItem = MyFolder.Items("Zip1"
'myItem.Display
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "j:\Folder\SubFolder\" & myAttachments.Item(1).DisplayName
End Function
I get several downloads daily from an outside agency as zip files which I must export to a folder, unzip, and rename. I finally got this to work but now I need to get these messages out of my inbox and into deleted items folder with code. These downloads also arrive on weekends so I need to automate this for the weekend. Why do I need to do this because the downloads come with the same name for attachments every day. Any Ideas? I am using Access 97.