public static void main(String[] args) {
题目
public static void main(String[] args) {
// 启动Word,生成一个ActivexComponent对象
ActiveXComponent app = new ActiveXComponent("Word.Application");
Map mapBookMark = new HashMap();
mapBookMark.put("name","123");
// 要转换的word文件
String inFile = "d:\1.doc";
// 要报存的目标文件
String tpFile = "d:\2.doc";
try {
app.setProperty("Visible",new Variant(true));
// 打开word文件
Dispatch docs = (Dispatch) Dispatch.get(app,"Documents")
.toDispatch();
Dispatch doc = Dispatch.invoke(
docs,
"Open",
Dispatch.Method,
new Object[] { inFile,new Variant(false),
new Variant(true) },new int[1]).toDispatch();
Dispatch activeDocument = app.getProperty("ActiveDocument")
.toDispatch();
Dispatch bookMarks = app.call(activeDocument,"Bookmarks")
.toDispatch();
// 标签替换
Iterator it = mapBookMark.keySet().iterator();
while (it.hasNext()) {
String bookMarkKey = (String) it.next();
String bookMarkNewValue = (String) mapBookMark.ge
答案
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
- i will contact you early next month.contact后为什么不加with,我曾看到有的句子里是加的难道两种用法
- 求导数e^y+xy-3=0
- 举一反三中的举是什么意思
- 在△ABC中,若ㄥBˉㄥA=30.,ㄥCˉㄥB=60.,则ㄥA=(),ㄥB=(),ㄥC=().
- 友人惭,下车引之,元方入门不顾的意思.
- what do most people do ___ this holiday?
- 某汽车制造厂上个月制造汽车300辆,超过计划60辆,超产( )辆
- 某商店有两个进价不同的计算器都卖了64元,其中一个盈利60%,另一个亏本20%,在这次买卖中,这家商店( ) A.不赔不赚 B.赚8元 C.赔8元 D.赚32元
- 文章一般开头几自然段的作用有哪些
- the graph shows the length of the spring increases as the mass suspended from the spring increases.
热门考点