title: Not able to append word document when I am inserting multiple image into word using java
body: <p>I used below code for taking snapshot of screen and save into a word file..
  This code is used as button..
  but when i take gain a screen shot it replace the existing file..
  How can i append this ..pls suggest 
  thanks in advance. :) </p>
  
  <pre><code>private void btnmanActionPerformed(java.awt.event.ActionEvent evt) {
      setVisible(false);
  
      if (btnman.getText().equals("Quick ScreenShot")) {
  
          try {
              Calendar now = Calendar.getInstance();
              Robot robot = new Robot();
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              Rectangle captureRect = new Rectangle(0, 0, 1430, 840);
              BufferedImage screenFullImage = robot.createScreenCapture(captureRect);
  
              ImageIO.write(screenFullImage, "JPG", new File(path.getText() + formatter.format(now.getTime()) + ".jpg"));
              img = path.getText() + formatter.format(now.getTime()) + ".jpg";
              System.out.println(img);
              setVisible(true);
          } catch (Exception es) {
              System.out.println("not done");
          }
      } else {
  
          try {
              Calendar now = Calendar.getInstance();
              Robot robot = new Robot();
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              Rectangle captureRect = new Rectangle(0, 0, 1400, 850);
              BufferedImage screenFullImage = robot.createScreenCapture(captureRect);
  
              ImageIO.write(screenFullImage, "JPG", new File("E:\\" + formatter.format(now.getTime()) + ".jpg"));
              img = "E:\\" + formatter.format(now.getTime()) + ".jpg";
              System.out.println(img);
              setVisible(true);
          } catch (Exception es) {
              System.out.println("not done");
          }
  
  
          XWPFDocument doc = new XWPFDocument();
  
          XWPFParagraph title = doc.createParagraph();
          XWPFRun run = title.createRun();
          run.setText(path.getText());
          run.setBold(true);
          title.setAlignment(ParagraphAlignment.CENTER);
          try {
              is = new FileInputStream(img);
  
              //run.addBreak();
              run.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, img, Units.toEMU(500), Units.toEMU(600));
  
              //is.close();
              System.out.println(img);
              System.out.print(path.getText());
  
              FileOutputStream fos = new FileOutputStream(path.getText());
  
  
              doc.write(fos);
              fos.close();
              System.out.println("Enterd successfully");
  
          } catch (Exception es) {
              System.err.println("es");
          }
  
  
      }
  }
  </code></pre>