JAVA/CORBA CLASSES


Examples: embedObject method
This agent creates a rich text item and embeds an attachment.

import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
 public void NotesMain() {
   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();
     // (Your code goes here)
     Database db = agentContext.getCurrentDatabase();
     Document doc = db.createDocument();
     doc.replaceItemValue("Subject", "Attachment");
     RichTextItem body = doc.createRichTextItem("Body");
     body.appendText("Here is the attachment:");
     body.addNewLine(2);
     body.embedObject(EmbeddedObject.EMBED_ATTACHMENT,
     null, "c:\\notes\\notes.ini", "notesini");
     // Save the document
     doc.save(true, true);
   } catch(NotesException e) {
     System.out.println(e.id + " " + e.text);
     e.printStackTrace();
   }
 }
}

See Also