Hi,
i've created an ole-frame and clientsite to import and execute a makro inside a word-application. When is try to run the macro (it takes up to 5 min. to execute it) inside the native OleEditor of eclipse the operation will finish successfully. The code does look like this:
OleEditor editor = (OleEditor) IDE.openEditor(window.getActivePage(), job.getTemplate());
editor.showBusy(true);
InteropHelper.importAndRun(editor.getClientSite(),job.getMakro().getAbsolutePath());
if(editor.isDirty())
editor.doSaveAs();
This operation will block the Ui for up to 5 minutes.Because of this i tried to execute the makro "in background".
The code does look like this:
final Display display = window.getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
@Override
public void run() {
OleFrame frame = new OleFrame(shell, SWT.MODELESS);
shell.setVisible(false);
monitor.subTask("Creating Word-bridge");
OleClientSite clientSite = new OleClientSite(frame, SWT.NULL, new File(openFilename));
clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
monitor.worked(1);
monitor.subTask("Handle word application");
InteropHelper.handleWord(clientSite);
monitor.worked(1);
monitor.subTask("Import and running makro (this will take a couple of minutes)");
InteropHelper.importAndRun(clientSite, makro.getAbsolutePath());
monitor.worked(1);
...
My problem is now that in the secound solution the Word-Application in background stops working for no reason!
I tried to figure out at which point the execution stops and it seems that it stop at the vb-code which moved the cursor in a loop. The code looks like this. Could it be that the ole-bridge has some problems with it? When i move the cursor a single line the code continuous...