Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[]{docPath, new Variant(8)}, new int[1]);
new Variant(8)代表将word文档另存为htm,new Variant()传入的参数不同转换的格式也不同,如下参数说明:
0:doc
1:dot
2-5:txt
6:rtf
7:txt
8/10:htm
11:xml
12/16:docx
13:docm
14:dotx
15:dotm
17:pdf