ciscohabdbook
ciscohabdbook
2016-01-22 02:59

QT 如何将 word文档嵌入窗体

5
  • qt
  • word

#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条回答

为你推荐

换一换