Hello,
The problem we face has been previously discussed in this forum under the same Subject as above.
But this time I believe we have found the reason why the problem occurs.
The problem: Some users create Lotus documents, and then using a button(lotusscript) they create/edit/read a word document that is attached in a RTF in the lotus document.
At some point (several days later or even the same day) the Lotus Notes document, looses almost all of its fields, as if someone runs an agent that calls the Call doc.Remove(fieldname).
We don’t do that! But we do something else. When the user finishes editing the Word document the script removes the contents of the Rich Text field and re-attaches the document back to it.
Here is the code:
If currdoc.Hasitem( “myRTField”) Then
Set rtitem = currdoc.GetFirstItem( "myRTField" )
If (rtitem.Type = RICHTEXT) Then
If Not Isempty(rtitem.EmbeddedObjects) Then
Forall x In rtitem.EmbeddedObjects
If ( x.Type = EMBED_ATTACHMENT ) Then
Call x.Remove
End If
End Forall
End If
If (Not DocUniversalID = "") Then
Set object = rtitem.EmbedObject(EMBED_ATTACHMENT, "",path,"")
Call currdoc.save(True, True)
End If
End If
End If
Our belief is that the Forall x In rtitem.EmbeddedObjects is getting a handle somehow on the document itself and the Remove takes place on the individual fields and not on the Rich Text field.
The reason why we believe this is the cause of the problem, is because everytime we loose the fields of from a document the RTfield holds two attachments where it should only have one. We re-attach in the last IF statement above.
Please do give me your thoughts why Lotus Notes behaves like this and if you agree that this might be the reason we loose the fields.
Thanks.