I am having trouble opening a word document from my application. My Code is as follows:
String execProg =
"C:\\Program Files\\MicorsoftOffice\\winword.exe";
String filePath =
"C:\\Documents and settings\\Owner\\My Documents\\my.doc";
try{
Runtime.getRuntime().exec(execProg + " " + filePath);
}catch(IOException ioe){}
For some reason the winWord program opens fine but when it tries to open the file I get an error. It seems that the file path is getting parsed at the spaces and the whole file path is not getting used. The error is get is
"File c:\Documents.doc is not a valid or the path is wrong"
Any suggesttions?
String execProg =
"C:\\Program Files\\MicorsoftOffice\\winword.exe";
String filePath =
"C:\\Documents and settings\\Owner\\My Documents\\my.doc";
try{
Runtime.getRuntime().exec(execProg + " " + filePath);
}catch(IOException ioe){}
For some reason the winWord program opens fine but when it tries to open the file I get an error. It seems that the file path is getting parsed at the spaces and the whole file path is not getting used. The error is get is
"File c:\Documents.doc is not a valid or the path is wrong"
Any suggesttions?