Sub Initialize
Dim Pfad As String
Pfad = "C:\"
Dim doc As NotesDocument
Dim obj As NotesEmbeddedObject
Dim rtitem As NotesRichTextItem
Dim collection As NotesDocumentCollection
Dim db As NotesDatabase
Dim session As New NotesSession
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
Set rtitem = doc.GetFirstItem( "Body" )
Forall o In rtitem.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then ' ist Dateianhang?
If Ucase(Right(o.Source, 4)) = Ucase(".jpg") Then ' ist Dateiendung jpg?
Call o.ExtractFile(Pfad & o.Source) ' abhängen
End If
End If
End Forall
Set doc = collection.GetNextDocument(doc)
Wend
End Sub