Thursday, 15 May 2014

c++ - ActiveQt: Activate an already open word document -


I am trying to write an open word document using activeQt. I am trying to activate my Word document, but I can not do it at work.

I can do this easily in VBA:

  document ("my.doc"). But activate   

, but not in QT, I have tried it:

  wordApplication = new QAxObject ("Word.Application"); Doc = wordApplication-> Query SubObject ("document ()", "my.doc"); Doctor & gt; DynamicCall ("active ()");   

The document () has to include all open word documents, but for me it is empty for some reason.

I found a solution to my problem, using the setControl function with the UUID for the word I already Only one word opened was able to access the document.

QAxObject * wordApplication; QAxObject * Doctor; WordApplication = New QAxObject (this); WordApplication- & gt; SetControl (("{000209FF-0000-0000-C000-000000000046} & amp;");; Doc = wordApplication-> Query SubObject ("document ()", "my.doc");

No comments:

Post a Comment