Sub GetMailAttachments() 'Dim Variables. When working with COM I have to declare all Variables Dim session As New NotesSession Dim DomDoc As NotesDocument Dim rtitem As Variant 'Notes Rich Text Item Dim NotesDb As NotesDatabase Dim DomView As NotesView Dim o As Variant 'This is for the File Attachment Dim DomDocs As NotesViewEntryCollection 'Initialize the connection to Notes Call session.Initialize Set NotesDb = session.GetDatabase("", "") 'Open Notes Database Set DomView = NotesDb.GetView("") 'Get the folder where all the e-mails are Set DomDoc = DomView.GetFirstDocument() 'Get first Document in Folder While Not DomDoc Is Nothing 'Make sure that there is a document to process Set rtitem = DomDoc.GetFirstItem("Body") 'Get the rich text item to look for the attachment If (rtitem.Type = RICHTEXT) Then 'Make sure the Field "BODY" is a Rich Text field For Each o In rtitem.EmbeddedObjects 'for each file attachment do the following If (o.Type = EMBED_ATTACHMENT) Then 'Test to make sure the embedded object type is a file attachment Call o.ExtractFile("" & o.Name) 'Extract the file for the directory listed and name it the same name as the attachment End If Next o End If Set DomDoc = DomView.GetNextDocument(DomDoc) 'Get the next document in the Folder to be processed Wend Set DomDocs = DomView.AllEntries 'Get all entries in the Folder that have been processed Call DomDocs.PutAllInFolder("") 'Put all the processed docs into the Processed Folder Call DomDocs.RemoveAllFromFolder("") 'Remove the processed docs from the to be processed folder End Sub