Examples: appendRTItem method

This agent creates a rich text item and appends the contents of another rich text item.

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", "Copy of first document");
      doc.replaceItemValue("Form", "Memo");
      RichTextItem body = doc.createRichTextItem("Body");
      body.appendText("Here is the body of the first document:");
      body.addNewLine(2);
      DocumentCollection dc = db.getAllDocuments();
      Document doc1 = dc.getFirstDocument();
      RichTextItem rti = 
      (RichTextItem)doc1.getFirstItem("Body");
      body.appendRTItem(rti);
      // Send the document
      doc.send("Roberta Person");
    } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}