I'am looking for a way to open a MS Word application with Java and after user finish to edit opened document with MS Word the process must upload modified file into database.
I have tryed to use Process command and waitFor method but Java is not waiting for the process to finish..
Any other solution? or idea how to do this? example:
public static void main(String[] args) {
try {
int exitValue = 0;
//open MS WORD....
Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler winword "+filename);
//wait for a process to finish..
int i = p.waitFor();
//upload modified file to database
upload(...);
System.out.println(i);
} catch (IOException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
} catch (InterruptedException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
}
}