import java.io.*;
public class OpenWord
{
public static void main(String[] args){
try{
String fileName = "C:\\New.doc";
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \""+fileName+"\"");
// OR YOU CAN USE
Runtime.getRuntime().exec("cmd /c \""+fileName+"\"");
}catch(IOException err){ // or use catch(Throwable err)
System.out.println("ERROR...."+err);
}
}
}