NotesMIMEEntity.Remove - Issue with large multi-part mime entities. Not all mime is removed

According to the Designer Help DB,

Remove method

Removes the current MIME entity and its children.

The example code page includes the statement, “This agent removes the MIME entity or all MIME entities (in the case of a multipart MIME entity) from the current document.”

So I feel pretty confident that when I run the following code, all the stored mime information for the concerned NotesItem should disappear.

Sub Initialize()

Dim s As New NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument

Dim item As NotesItem

Dim mime As NotesMIMEEntity

Set db = s.CurrentDatabase

s.ConvertMIME = False

Set dc = db.UnprocessedDocuments

Set doc = dc.GetFirstDocument

If Not(doc Is Nothing) Then

	Set item = doc.Getfirstitem("Body")

	Set mime = item.GetMIMEEntity

	If Not(mime Is Nothing) Then

		Call mime.Remove

	End If

	Call doc.Save(True, True)

End If

s.ConvertMIME = True

End Sub

Well, this works fine, until the NotesItem contains a lot of information. At this point, not all the information is removed. In our situation, as the document has it’s NotesItem recreated and removed multiple times, the document grows quite large with remnant $FILE leftovers that I assume are MIME data not removed.

Doing this in the 8.5.1 client and on Domino 8.5 …

Initial save

After mime removal

After a few more cycles of testing, with the same content in the field as was there after the initial save

If I start with a smaller amount of data stored as HTML/MIME, it is removed completely

Any thoughts out there on how to best remove ALL the mime data related to a Rich Text Field - especially when multiple RTF’s will be involved?

Thanks.