Hello, I want to show MS Word in QWidget, I 've tried like this:
In a QWidget's constructor:
QString qsFileName
( "D:/Test/Test.doc" );
setLayout( playout );
playout->addWidget( pAxWidget );
playout->setMargin( 0 );
pAxWidget ->setControl( qsFileName );
QString qsFileName( "D:/Test/Test.doc" );
QHBoxLayout *playout = new QHBoxLayout( this );
setLayout( playout );
QAxWidget *pAxWidget = new QAxWidget( this );
playout->addWidget( pAxWidget );
playout->setMargin( 0 );
pAxWidget ->setControl( qsFileName );
To copy to clipboard, switch view to plain text mode
Use this method, I can show it in a QWidget, but these menubars and commandbars are hidden.
So I tried to make them visible like this:
QAxObject *pStandard
= pAxWidget
->querySubObject
( "CommandBars( const QVariant & )",
"Standard" );
pStandard->dynamicCall( "Enabled", true );
pStandard->dynamicCall( "Visible", true );
QAxObject *pFormatting
= pAxWidget
->querySubObject
( "CommandBars( const QVariant & )",
"Formatting" );
pFormatting->dynamicCall( "Enabled", true );
pFormatting->dynamicCall( "Visible", true );
QAxObject *pStandard = pAxWidget->querySubObject( "CommandBars( const QVariant & )", "Standard" );
pStandard->dynamicCall( "Enabled", true );
pStandard->dynamicCall( "Visible", true );
QAxObject *pFormatting = pAxWidget->querySubObject( "CommandBars( const QVariant & )", "Formatting" );
pFormatting->dynamicCall( "Enabled", true );
pFormatting->dynamicCall( "Visible", true );
To copy to clipboard, switch view to plain text mode
but I still cannot see any commandBar.
Can you help me? Thanks.
Bookmarks