import com.jacob.activeX.ActiveXComponent; 
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch; 
import com.jacob.com.Variant;public class MSWordManager {
  public static void main(String[] args) {
    ComThread.InitSTA();// 初始化com的线程,非常重要!!使用结束后要调用 realease方法
    ActiveXComponent objWord = new ActiveXComponent("Word.Application");
    Dispatch wordObject = (Dispatch) objWord.getObject();
    //word.setProperty("Visible", new Variant(visible)); 
    Dispatch.put((Dispatch) wordObject, "Visible", new Variant(false));// new Variant(true)表示word应用程序可见
    Dispatch documents = objWord.getProperty("Documents").toDispatch(); //documents表示word的所有文档窗口,(word是多文档应用程序)
    Dispatch document = Dispatch.call(documents, "Open","e:\\wow.doc").toDispatch(); // 使用Add命令创建一个新文档,用Open命令可以打开一个现有文档
  
    Dispatch selection = Dispatch.get(objWord, "Selection").toDispatch();  //光标位置
    
    //Dispatch wordContent = Dispatch.get(document, "Content").toDispatch(); // 取得word文件的内容
    
    Dispatch tables = Dispatch.get(document, "Tables").toDispatch();
    Dispatch table = Dispatch.call(tables, "Item",new Variant(1)).toDispatch() ;
    Dispatch rows = Dispatch.get(table, "Rows").toDispatch();// 表格的所有行
    
    Dispatch cell = Dispatch.call(table, "Cell",
                new Variant(1),
                new Variant(1)).toDispatch();  //得到单元格
        Dispatch.call(cell, "Select").toDispatch();// 选中单元格
//        Dispatch font = Dispatch.get(selection, "Font").toDispatch();// 设置格式
//        Dispatch.put(font, "Bold", "0");
//        Dispatch.put(font, "Italic", "0");
        Dispatch.put(selection, "Text", "彭小东");// 填入数据
    
    
    Dispatch.call(document, "SaveAs", new Variant("e:\\178.doc")); // 保存一个新文档
    ComThread.Release();//释放com线程。根据jacob的帮助文档,com的线程回收不由java的垃圾回收器处理                      
  }
}
到底有个什么错误,看半天搞不出来,求大牛!