I have been trying to read as much on stackoverflow about this as possible, but I need to open an outlook offline template (.oft) file. Then have a file attached to it. I will put the command into a java application.
I would use a command line switch, but it creates a new message with the attachment and opens the oft file, it’s not attaching it to the .oft.
"C:\Program Files (x86)\Microsoft Office\Office14\Outlook.exe" /f "C:\RSASoftToken\android.msg" /a "C:\RSASoftToken\android\WMH7.sdtid"
If there is a way to get command line to work, that would be the easiest. If not what else can I do in java?
I need to add it to this code
//the New File Name
String newFileName = Prefix + fileName.substring(0,4) + Suffix + fileExtension;
String tentativeName = "new Filename will be ->"+newFileName+"\n";
System.out.println(tentativeName);
if(cbxAndroid.isSelected() == true ){
try { Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("cmd /c \\RSASoftToken\\TokenConverter.exe \\RSASoftToken\\android\\"+newFileName+" -android -o \\RSASoftToken\\android\\"+newFileName.substring(0,4)+".txt");
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line=null;
while((line=input.readLine()) != null) {
System.out.println(line); }
int exitVal = pr.waitFor();
System.out.println("Exited with error code "+exitVal);
} catch(Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}
}
Here’s how you would execute that command from Java:
You can then call the
getXxxStream()methods on theProcessobject to get streams for writing to the external processes standard input and reading from its standard output and standard error.However, I don’t understand what you are really trying to do here, or whether running this command will allow you to achieve it.