I have a Notes database with documents which each contain a number of files attached in a rich-text field.
When I try to delete the attachments, with a LotusScript agent, using NotesEmbeddedObject.Remove, the attachment is removed, but the icon for the removed attachment still remains visible in the RT field.
Any attempt to access the removed attachment by clicking on the icon results in a “Note Item Not Found” error, as might be expected.
Does anyone know how I can make the redundant icon disappear, please?
I have tried NotesDocument.ComputeWithForm after the NotesEmbeddedObject.Remove, but it didn’t work…
Subject: Deleting attachments by LotusScript - attachment is deleted but the icon remains visible
If you have not closed and reopened the form containing the richtext field, then the icon will still be there because rich text fields do not refresh. There is no other way to get a rich text field to update itself other than to close the UIdocument and reopen it.
Subject: RE: Deleting attachments by LotusScript - attachment is deleted but the icon remains visible
Simply opening the document, refreshing it and then saving it doesn’t work, either.The icon still stays there, unless it is actually deleted from the UI document…
Subject: Deleting attachments by LotusScript - attachment is deleted but the icon remains visible
Are you obtaining the notesembeddedobjects from the notesdocument or from the notesrichtextitem? Both of these have an embeddedobjects property and IIRC the former encompasses the latter. I haven’t done this in quite a while but if you remove the attachments via the document that would leave the rich text pointer thingie - the icon, basically - behind.