views:

39

answers:

0

Hi,

I am using Qt 4.5 and using ActiveQt to generate MS Word documents. I am able to create a document based on the ActiveX commands of VBA for MS Word. But I am not able to create a new page at the desired position.

I tried

selection->dynamicCall("InsertBreak(const QString &)","wdPageBreak");
selection->dynamicCall("InsertParagraph(void)");
QAxObject *partTableParagraph = activeDocument->querySubObject("Paragraphs(1)");
partTableParagraph->setProperty("PageBreakBefore","True");
QAxObject *partTableRange = partTableParagraph->querySubObject("Range");
selection->dynamicCall("TypeText(const QString&)","second page contents");

but still I am not able to create a new page in the word document. Also the contents aren't visible for the second page. i.e second page contents isn't visible.

Any pointers regarding this are welcome.