Examples: addNewLine, addPageBreak, addTab, and appendText methods
This agent creates a rich text item, appends text, and adds new lines, page breaks, and tabs.
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();
Item subject = doc.replaceItemValue("Subject","Rich text item");
RichTextItem body = doc.createRichTextItem("Body");
body.appendText("This is the first sentence.");
body.appendText(" This is the second sentence.");
body.addNewLine(2);
body.appendText("This is a new paragraph.");
body.addPageBreak();
body.appendText("Column 1");
body.addTab();
body.appendText("Column 2");
body.addNewLine();
body.appendText("Element A1");
body.addTab();
body.appendText("Element B1");
body.addNewLine();
body.appendText("Element A2");
body.addTab();
body.appendText("Element B2");
// Save the document
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}