Dim o as variant Dim curdoc as notesdocument set curdoc = (notessession).documentcontext Set o = curdoc.EmbeddedObjects(0)This does not work. I can only attach it on a field thanks to @command([filesave]). Please help me.
The EmbeddedObjects property on the NotesDocument class is read-only, which excludes updating it. However, there are some enhancements in Rich Text processing in LotusScript in Domino 6 that make this much easier. First, bind a NotesRichTextItem object to the Rich Text field in the document that contains the attachment. You can then use the NotesRichTextNavigator method of the NotesRichTextItem class with RTELEM_TYPE_FILEATTACHMENT. You will then get an object that is a NotesEmbeddedObject class that has such methods as Remove and ExtractFile. Positioned within the Rich Text item, you can also add a new attachment with the EmbedObject method on the NotesRichTextItem class, thereby accomplishing the update.
Dig Deeper on LotusScript
Related Q&A from Maureen Leland
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.