Skip to Content
0
Former Member
Sep 02, 2008 at 02:14 PM

Execute Application from Webdynpro

7 Views

hello all,

for a future project i need to execute applications from a webdynpro project, loading documents of various types. this code is just for testing purposes...:


java.lang.String szCmd = "rundll32 SHELL32.DLL,ShellExec_RunDLL";
java.lang.String szFile = "c:\\example.doc";
	  
java.lang.Runtime run = Runtime.getRuntime();
	  
try
{
	Process proc = run.exec(szCmd+szFile);
}
catch (IOException e)
{ 
	throw new WDRuntimeException(e.getMessage());
}

i've also tried calling the applications directly, giving the document as parameter eg.


java.lang.String szWord = "c:\\program files\\microsoft office\\office11\winword.exe";
java.lang.String szFile = "http://somewhere.net/some.doc";

java.lang.Runtime run = Runtime.getRuntime();

try
{
	Process proc = run.exec(szCmd+" "+szFile);
}
catch (IOException e)
{ 
	throw new WDRuntimeException(e.getMessage());
}

well, referring to the task manager, it works. but the executed application is initially hidden. is there a way to make it visible? or is it possible to create the application object using ole/createobject/getobject mechanisms?

thanks for your help in advance.

regards,

chris