Hallo Dirk,
versuchs mal so:
Public Sub SaveAttachments()
Dim coll As VBA.Collection
Dim obj As Object
Dim Att As Outlook.Attachment
Dim Sel As Outlook.Selection
Dim Path$
Dim i&
Dim Zaehler As Long
Zaehler = 1
Path = "C:\Users\DB\.1 L1\PL\"
Set coll = New VBA.Collection
If TypeOf Application.ActiveWindow Is Outlook.Inspector Then
coll.Add Application.ActiveInspector.CurrentItem
Else
Set Sel = Application.ActiveExplorer.Selection
For i = 1 To Sel.Count
coll.Add Sel(i)
Next
End If
For Each obj In coll
For Each Att In obj.Attachments
Att.SaveAsFile Path & Att.Filename & Zaehler
Next
Zaehler = Zaehler + 1
Next
End Sub
Ich habe dir hier einen Zaehler eingebaut, der an das erste Attachment eine 1 anhaengt und dann immer hochzaehlt bis zum letzten Attachment. Also sollten die Dateien unterschiedlich benannt werden.
Gruss Torsten
|