資源簡介
Java 將員工表插入Word文檔中(基礎(chǔ)篇-實例477).zip
代碼片段和文件信息
import?com.jacob.com.*;
import?com.jacob.activeX.ActiveXComponent;
public?class?Inerttable?{
????//?word文檔
????private?Dispatch?doc;
????
????//?word運行程序?qū)ο?br/>????private?ActiveXComponent?word;
????
????//?所有word文檔集合
????private?Dispatch?documents;
????
????//?選定的范圍或插入點
????private?Dispatch?selection;
????
????private?boolean?saveOnExit?=?true;
????
????public?Inerttable()?{
????????ComThread.InitSTA();//?初始化com的線程,非常重要!!使用結(jié)束后要調(diào)用?realease方法
????????if?(word?==?null)?{
????????????word?=?new?ActiveXComponent(“Word.Application“);
????????????word.setProperty(“Visible“?new?Variant(false));
????????}
????????if?(documents?==?null)
????????????documents?=?word.getProperty(“Documents“).toDispatch();
????}
????
????/**
?????*?創(chuàng)建一個新的word文檔
?????*/
????public?void?crea
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????284??2013-11-18?09:30??.classpath
?????文件?????????379??2010-09-10?15:22??.project
?????文件?????????629??2010-09-10?15:22??.settings\org.eclipse.jdt.core.prefs
?????文件????????3527??2013-11-21?08:42??bin\Inerttable.class
?????文件???????34468??2013-11-18?09:24??lib\jacob.jar
?????文件????????4087??2010-09-10?15:22??src\Inerttable.java
評論
共有 條評論