JAVA/CORBA CLASSES
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) DocumentCollection dc = agentContext.getUnprocessedDocuments(); Document doc = dc.getFirstDocument(); Database db = agentContext.getCurrentDatabase(); Document newdoc = db.createDocument(); newdoc.appendItemValue("Form", "MainTopic"); newdoc.appendItemValue("Subject", "New document with attachment"); RichTextItem rti = newdoc.createRichTextItem("Body"); rti.beginSection(doc.getItemValueString("Subject")); RichTextItem body = (RichTextItem)doc.getFirstItem("Body"); rti.appendRTItem(body); rti.endSection(); newdoc.save(true, true); } catch(Exception e) { e.printStackTrace(); } } }
See Also