• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Launch MS Word from an applet

 
Seb Castiaux
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
what is the exact command to open a file in MS Word from an applet?
Thanks a lot,
S´┐Żbastien
 
Stanley Smith
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there... assuming that the executable path to Word is as i recorded... and the file name is MYFILE.doc you could use the following.
String[] cmdArray = new String[2];
cmdArray[0] = "c:\\Program Files\\Microsoft Office\\Office10\\winword.exe";
cmdArray[1] = "c:\\My Documents\\MYFILE.doc";
try {
Runtime.getRuntime().exec(cmdArray);
} catch (Exception exc) {}
Hope this helps!
Robin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic