Sub
OutlookPosteingang()
Dim
olApp
As
Outlook.Application
Dim
folder
As
Object
Dim
verz
As
Object
Dim
i
As
Integer
Dim
objMail
As
Outlook.MailItem
Dim
intAnlagen
As
Integer
Dim
strPath
As
String
Dim
Subject
As
MailItem
strPath = "L:\"
Set
olApp = Outlook.Application
Set
Items = Session.GetDefaultFolder(olFolderInbox).Parent.Folders(
"Posteingang"
).Items
For
Each
objMail
In
Items
If
objMail.
Class
= olMail
Then
With
objMail
intAnlagen = .Attachments.Count
And
objMail.Subject
Like
"*"
&
"abc.xlsx"
&
"*"
If
intAnlagen > 0
Then
For
i = 1
To
intAnlagen
.Attachments.Item(i).SaveAsFile strPath & "\" & .Attachments.Item(i).FileName
Next
i
End
If
End
With
End
If
Next
End
Sub