Sub
OutlookPosteingang()
Dim
olApp
As
Outlook.Application
Dim
folder
As
Object
Dim
verz
As
Object
Dim
i
As
Integer
Dim
intAnlagen
As
Integer
Dim
strPath
As
String
strPath = "L:\"
Set
olApp = Outlook.Application
Set
items = Session.GetDefaultFolder(olFolderInbox).Parent.Folders(
"Posteingang"
).items
For
anz = 1
To
items.Count
If
items(anz).
Class
= olMail
Then
With
items(anz)
intAnlagen = .Attachments.Count
And
.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