How can I detach all the attachments that are there in the different documents in a view without opening individual document in Edit mode separately?
Subject: How can I detach all the attachments that are there in the different documents in a view without opening individual document in Edit mode separately?
To access document attachments you need to find out which rich text field those attachments are bound to. For emails, that would be “Body”. Once you know the field name then use the NotesDocument.GetFirstItem method to get a handle on the rich text field object so that you can access its EmbeddedObjects collection.
Dim rti As NotesRichTextItem
Dim strFileName As String
Dim strOutputname As String
Dim bSave As Boolean
Dim strDirOutput As String
Dim tempitem As NotesItem
If doc.HasItem("Body") Then
Set rti = doc.GetFirstItem("Body")
If ( rti.Type = RICHTEXT ) Then
If Isempty(rti.EmbeddedObjects) = False Then
Forall att In rti.EmbeddedObjects
strFileName = "Attached" & doc.UniversalID & att.Source
strOutputName = strpath & strFileName
' Only extract file if it does not exist already
strDirOutput = Dir(strOutputName)
If strDirOutput <> strFileName Then
att.ExtractFile strOutputName
End If
End Forall
End If
End If
End If
Subject: RE: How can I detach all the attachments that are there in the different documents in a view without opening individual document in Edit mode separately?
Read about NotesEmbeddedObject class.