0

I am using COM4J to generate MS Office documents, but some times a process stop working.

I would like to know if there is a way to identify a PID of a application created using COM4J.

With the process id, I will kill the process that is blocking my queue.

import com4j.Variant;
import word._Application;
import word._Document;

public class WordDemo {
    public static void main(String[] args) {
        _Application app = word.ClassFactory.createApplication();
        app.visible(true);

        Integer pid = null
        //Integer pid = app.getProcessID();

        app.documents().add( Variant.getMissing(), false, false, true);
        app.selection().typeText("Welcome to com4j");
        app.selection().typeParagraph();
        app.selection().typeText("Your Java/COM bridging solution");

        System.out.println("Process ID # " + pid)
    }
}
Marcio Barroso
  • 783
  • 1
  • 7
  • 21
  • possible duplicate of [Get PID from Word ApplicationClass?](http://stackoverflow.com/questions/814936/get-pid-from-word-applicationclass) – Yogendra Singh Oct 29 '12 at 17:53
  • I tried as showed in this thread, but I am using Com4J as a MS Office bridge and I dont have a implicitly way to access the system process list. tks – Marcio Barroso Oct 30 '12 at 15:48

0 Answers0