Append NotesEmbeddedObject to NotesRichTextItem

Hello,

I tried to append a NotesEmbeddedObject to a RTF with LotusScript. But I couldn’t find any solution how to write an embedded Object to the RTF. Is this possible?

Here my code:

Dim attachment As NotesEmbeddedObject

Dim itemToCopy As Variant

Dim itemToAttach As Variant

Set itemToCopy = copyDoc.GetFirstItem(“RTF”)

Set attachment = itemToCopy.getEmbeddedObject(“test.txt”)

What I want to do is to attach the “attachment” to “itemToAttach”.

Thanks a lot for your help.

Subject: There’s no way to move just the embedded object…

…as a separate entity. You can, however, append the entire rich text field containing the object, to another field. Otherwise, if the object is an attachment, you can detach it to disk temporarily and attach it to the new document.

Subject: When copying RTF an Error occurs

Thanks for the reply. I tried to copy it and it is kind of working. The File is in the RTF, but the excel icon is not displayed. There is just a gray square visible.And also a warning message pops up: Notes item not found. Why does it happen?

I used to copy following code:

Call itemToAttach.appendRTItem(itemToCopy)

Subject: copying an attachment

You haven’t said very much about the situation where you’re running this code, so I’m not sure, but possibly this article will help: Front-end file attachments in LotusScript or this: Update rich text tip.

I would think that AppendRTItem would work, but perhaps you also need to copy over some $FILE items. See NotesDocument.Items and the NotesItem class.