ciscohabdbook
2016-01-22 02:59QT 如何将 word文档嵌入窗体
5#include "mainwindow.h"
#include
#include
#include
#include
#include
showWord_ex1()
{
QAxWidget word(0,0);
word.resize(400,400);
word.setControl(QString::fromUtf8("{000209FF-0000-0000-C000-000000000046}"));
word.setProperty("Visible", true);
QAxObject * documents = word.querySubObject("Documents");
documents->dynamicCall("Add (void)");
QAxObject * document = word.querySubObject("ActiveDocument");
word.show();
}
showFlash()
{
QAxWidget *flash = new QAxWidget(0,0);
flash->resize(1024,768);
// Shockwave Flash Object
flash->setControl(QString::fromUtf8("{d27cdb6e-ae6d-11cf-96b8-444553540000}"));
//flash->setControl(QString::fromUtf8("{00020900-0000-0000-C000-000000000046}"));
//flash->setObjectName("Shockwave Flash Object");
flash->dynamicCall("LoadMovie(long,string)",0,"c:/123.swf");
flash->show();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
showWord_ex1();
//showFlash();
//showWord_ex();
return a.exec();
}
代码如上:
flash 控件成功的嵌入窗体,但是word 文档,没有嵌入窗体,直接在窗体打开。
请大神解答:
要的效果就是 word文档嵌入窗体。
请提供可行的代码或者链接
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- VS2017+Qt5.9.4,moc文件Link出错
- qt59.4
- vs2017
- moc 文件
- 无法解析的外部符号
- 1个回答
- QT 查找文件中字符串并替换的问题
- qt
- c++
- 1个回答
- qt和vs2015新建ui的问题
- qt
- vs2015
- 3个回答
- Qt QSoundEffect播放声音文件不成功
- qt
- 2个回答
- QT creater 中 imshow error问题
- qtcreator配置opencv
- opencv
- ubuntu
- 3个回答