#include <QAxWidget>
QAxWidget *a = new QAxWidget("Word.Application");//打开Word
a->setControl(g_strSrcFilePath);//打开此Word文档
a->setProperty("Visible",false);//设置程序不显示
QVariant newFileName;
if (g_strSrcFilePath.endsWith(".docx"))
{
newFileName.setValue(g_strSrcFilePath.left(g_strSrcFilePath.size() - 5).append(".html"));
}
else if (g_strSrcFilePath.endsWith(".doc")){
newFileName.setValue(g_strSrcFilePath.left(g_strSrcFilePath.size() - 4).append(".html"));
}
QVariant fileFormat(10); //文件保存格式 HTML文件 这个值有几个枚举类型具体参考:WdSaveFormat枚举
QVariant LockComments(false);//注释
QVariant Password("");//设置打开密码
QVariant recent(false);//最近打开的文件
QVariant writePassword(""