Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

ActiveQt and word. Writing to an opened word document ?

$
0
0
I am trying to write to an open word document using ActiveQt. I am able to write to my word document (.doc) if it is closed, my code will open the document and then start writing to it. But if the document is already open it opens a read-only copy and not the original document. From what I have read it should be possible to activate an open word document and then start writing to it, but I cant get it to work with Qt. This is how I open the document: QAxObject * doc; QAxObject* wordApplication; wordApplication = new QAxObject("Word.Application",this); doc = wordApplication->querySubObject("Documents()"); doc->dynamicCall("Open(QVariant,QVariant,QVariant,QVariant,QVariant,QVariant,QVariant)","c:/my.doc",false,false,false,"","",false); Setting Revert to false, which is the 7th argument for the Open method, should do the following according to the word developer reference: Controls what happens if FileName is the name of an open document. True to discard any unsaved changes to the open document and reopen the file. False to activate the open document. For me it does not activate the open document, but opens a read-only copy and starts writing to that. I have found a VBA code that does what I want: Documents("my.doc").Activate I have tried making a corresponding code using ActiveQt without luck. I need to do something similar in my Qt code, any help would be greatly appreciated.

Viewing all articles
Browse latest Browse all 13965

Trending Articles