
word
可以用
wordapi组件来实现 代码大概是这样的:
Javaimport com.heavenlake.
wordapi.Document;public class test { public test() { Document doc = null; try { doc = new Document(); doc.open(e:/test.doc); // 打开文件 doc.insert(第一章:嘻嘻 biaoti); // 插入文字 doc.insertAtBookmark(testbookm, 第一章:嘻嘻 标题); doc.insertAtBookmark(testbookm, new
Java.io.File(E:/
照片/DSC236.JPG)); // 插入图片 } catch (Exception e) { e.printStackTrace(); } finally { try { if (doc != null) doc.close(true); } catch (Exception e) { e.printStackTrace(); } } } public static void m
AIn(String args) { test test1 = new test(); }}
这段代码应该能实现你想要的功能,有需要可以拿去参考~