Examples: appendDocLink method

This agent creates a rich text field and appends doc links.

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", "Doc links");
      doc.replaceItemValue("Form", "Memo");
      RichTextItem body = doc.createRichTextItem("Body");
      body.appendText("Here are the links:");
      body.addNewLine(2);
      body.appendDocLink(db, db.getTitle(), "Database link");
      body.addNewLine();
      body.appendDocLink(doc, 
      doc.getItemValueString("Subject"),
      "Document link");
      // Send the document
      doc.send("Pierre LaPierre");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}