title: Java Spring, extract a certain textbox from .docx
body: <p>Right now, I'm using apache.poi in my spring webapp to extract the whole content of a previously uploaded .docx.</p>
  
  <pre><code>public Details getDetailsFromFile(String file) throws IOException, InvalidFormatException {
      Details details = new Details();
      FileInputStream fis = new FileInputStream(env.getProperty("rootlocation") + "/" + file);
      XWPFDocument xdoc = new XWPFDocument(OPCPackage.open(fis));
      XWPFWordExtractor extractor = new XWPFWordExtractor(xdoc);
      details.setText(extractor.getText());
  
      return details;
  }
  </code></pre>
  
  <p>Is there a way to assign something like an ID to a textbox in the .docx and extract only that, instead of getting the whole content of the .docx and split it using application logic? How would you assign the ID in the .docx and then extract it using Java?</p>