The following LotusScript will successfully copy attachments to the given directory, but the attachments remain embedded in the Notes documents, despite the code calling for their removal.
*************************
Sub Initialize
Dim s As New NotesSession
Dim DC As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Set DC = s.CurrentDatabase.UnprocessedDocuments
Set Doc = DC.GetFirstDocument
Do Until Doc Is Nothing
Set rtitem = doc.GetFirstItem("ProposalAttachment")
If (rtitem.Type = RICHTEXT) Then
Forall o In rtitem.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then
Call o.ExtractFile ("G:\Projects\Lotus_PAS_Attachments\" & o.Source)
Call o.Remove
End If
End Forall
End If
Set Doc = DC.GetNextDocument (Doc)
Loop
End Sub
**************************
Is there code other than Call o.Remove that I need to add? I'm at a loss.
JP
*************************
Sub Initialize
Dim s As New NotesSession
Dim DC As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Set DC = s.CurrentDatabase.UnprocessedDocuments
Set Doc = DC.GetFirstDocument
Do Until Doc Is Nothing
Set rtitem = doc.GetFirstItem("ProposalAttachment")
If (rtitem.Type = RICHTEXT) Then
Forall o In rtitem.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then
Call o.ExtractFile ("G:\Projects\Lotus_PAS_Attachments\" & o.Source)
Call o.Remove
End If
End Forall
End If
Set Doc = DC.GetNextDocument (Doc)
Loop
End Sub
**************************
Is there code other than Call o.Remove that I need to add? I'm at a loss.
JP