Examples: getEmbeddedObject method

This agent examines the documents in a database to see which ones contain a specified embedded object.

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();
      DocumentCollection dc = db.getAllDocuments();
      Document doc = dc.getFirstDocument();
      while (doc != null) {
        RichTextItem body = 
        (RichTextItem)doc.getFirstItem("Body");
        if (body.getEmbeddedObject("notes.ini") != null)
          System.out.println("Found notes.ini in " +
          doc.getItemValueString("Subject"));
        doc = dc.getNextDocument();
        }
    } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}