PDA

View Full Version : How to embed WordViewer in qwidget



mouni
3rd August 2016, 07:16
Hi Friends,

i want embed wordviewer in my widget plz sent some code to embed word viewer in qwidget...

d_stranz
3rd August 2016, 19:10
Anything else you want us to do while we're writing your project for you? What have you done to research the problem? What have you tried besides making a post here and telling us to give you code?

mouni
4th August 2016, 06:43
Hi,

This is my code i used it is working in my system with msWord 2016 in windows10...In another systems it is not working..plz Help me to solve

QString nPath;
nPath = QFileDialog::getOpenFileName(this,"select DOC files",qApp->applicationDirPath(),"*.doc *.docx");
m_pAxWidget = new QAxWidget(this);
ui->gridLayout->addWidget(m_pAxWidget);
m_pAxWidget->setControl(nPath );

d_stranz
4th August 2016, 16:15
Read the documentation for QAxBase::setControl(). You are using the 4th method - setting the name of the file. This is probably the least reliable way to do it, because it requires having the ActiveX control installed -and- registered as the server for the .doc / .docx file extensions. This might be true on your development system, but probably isn't the case on the system you are trying to move your code to.

You don't check the return value from "setControl" (a Boolean), which will be false if the call fails to create the ActiveX object instance.