import com.heavenlake.wordapi.Document;
import java.util.ArrayList;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 天池软件2006</p>
* <p>Company: 天池软件</p>
* @author 赵光
* @version 1.0
*/
public class testInsertTable {
public testInsertTable() {
Document doc = null;
try {
doc = new Document();
doc.newDoc("e:/test4.doc");
doc.insertln("测试文档");
doc.insertln("天池软件产品列表");
//doc.saveAs("e:/test2.doc");
ArrayList tableData = new ArrayList(3);
String[] title = {
"序号", "代码", "名称","网址"};
tableData.add(title);
String[] field1 = {
"1", "751002", "天池软件自动化生产平台","www.heavenlake.com"};
tableData.add(field1);
String[] field2 = {
"2", "751004", "产品数据管理系统","pdm.heavenlake.com"};
tableData.add(field2);
//doc.insert(tableData);
doc.insert(tableData,"流行型");
doc.insert("表格结束","标题 1");
doc.insertln();
doc.insert("文档结束");
}
catch (Exception e) {
e.printStackTrace();
}
finally {
try {
if(doc!=null) doc.close(true);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
testInsertTable test1 = new testInsertTable();
}
}
java2word doc
5星 · 超过95%的资源 需积分: 31 124 浏览量
2008-09-02
10:05:24
上传
评论
收藏 74KB RAR 举报
handsome224521
- 粉丝: 3
- 资源: 11
最新资源
- 基于STM32使用HAL库实现USB组合设备之多路CDC源码+说明文档.zip
- 金融贸易项目springboot
- mybatis动态sqlSQL 映射 XML 文件是所有 sql 语句
- 基于基于STM32的智能家居系统源码+qt上位机源码.zip
- 深圳房地产资源数据报告
- 基于stm32的智能门禁系统源码+设计文档+演示视频.zip
- cef + chromium 完整源码支持h265和h264
- 基于SpringBoot的API管理平台源代码+数据库,以项目的形式管理API文档,可以进行API的编辑、测试、Mock等操作
- protobuf 3.11版本,静态编译
- 2023NOC创客智慧编程赛项真题图形化-选拔赛(有解析)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈