Examples: renderToRTItem method

This agent puts a picture of a document in another document and sends it.

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();
      DocumentCollection dc = db.search("Subject = 
                   \"Test appendItemValue\"");
      if (dc.getCount() == 1) {
        Document doc = dc.getFirstDocument();
        Document memo = db.createDocument();
        memo.appendItemValue("Form", "Memo");
        memo.appendItemValue("Subject", 
                   "Picture of Test appendItemValue");
        RichTextItem rti = memo.createRichTextItem("Body");
        memo.save();
        doc.renderToRTItem(rti);
        memo.send(session.getUserName()); }
      } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}