Examples: createRichTextItem method

This agent creates a rich-text item.

import lotus.domino.*;
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("Form", "Main Topic");
      doc.replaceItemValue("Subject", "Forest icon");
      RichTextItem rtitem = doc.createRichTextItem("Body");
      rtitem.embedObject(EmbeddedObject.EMBED_ATTACHMENT,
      null, "C:\\Windows\\forest.bmp", "Forest icon");
      doc.save();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}