Examples: getReceivedItemText method

This agent displays the text of the Received items in the current document.

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) 
      DocumentCollection dc = agentContext.getUnprocessedDocuments();
      Document doc = dc.getFirstDocument();
      Vector received = doc.getReceivedItemText();
      if (received.size() > 0) {
        for (int i = 0; i < received.size(); i++) {
          System.out.println("***Received item " + (i + 1) + "***");
          System.out.println(received.elementAt(i) + "\n");
        }
      }
      else
        System.out.println("No received items in document");

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}