Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to use QAxobject in Qt



  • Hello,
    I want to W/R word in Qt;

    I know I can use QAxobject to access word like:
    m_axobj = new QAxWidget("Word.Application");
    m_axobj->querySubObject("Documents");
    ..................
    docs->querySubObject("Tables");
    querySubObject("Range()")->property("Text").toString()

    my problem is where can I find the name of the COM object? where can I find the "word " 's com obj name,method,poperty?
    querySubObject("Documents"); docs->querySubObject("Tables"); querySubObject("Range()")->property("Text")

    where can i find a document to tell me the name like "documents","tables","Range","text", that i should use in the querySubObject or property,so i can access the word.
    Thank you!



  • @lso70
    This is not supplied by Qt. You have to read MS documentation, to see all the "Automation" calls/objects available. I don't know if this is the best, but here is one you could start from:
    https://docs.microsoft.com/en-us/office/vba/api/word.application
    Notice how you are in book "Office VBA Reference".



  • @lso70
    This is not supplied by Qt. You have to read MS documentation, to see all the "Automation" calls/objects available. I don't know if this is the best, but here is one you could start from:
    https://docs.microsoft.com/en-us/office/vba/api/word.application
    Notice how you are in book "Office VBA Reference".



  • @JonB that's what I want,thank u much!


Log in to reply