title: How do I get all the attachments from a .nsf(lotus notes) file using java
body: <p><strong>Steps followed :</strong> </p>
  
  <p>Took a back of my lotus notes as sample.nsf</p>
  
  <p>And then tried to read the attachments from the sample.nsf</p>
  
  <p><strong>Code snippet :</strong></p>
  
  <pre><code>Database db = session.getDatabase("","C:\\Projects\\NotesToJava\\sample.nsf");
  DocumentCollection dc = db.getAllDocuments();
  Document doc = dc.getFirstDocument();
  
  while (doc != null) {
      RichTextItem body = (RichTextItem) doc.getFirstItem("Body");
  
      if (body.getEmbeddedObject("Request.xlsx") != null)
           System.out.println("Found BPM_Dev_Access_Request.xlsx in " + doc.getItemValueString("Subject"));
  
      doc = dc.getNextDocument();
  }
  </code></pre>