Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt ActiveX retrieving the number of pages in a word document
Qt 6.11 is out! See what's new in the release blog

Qt ActiveX retrieving the number of pages in a word document

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 766 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    Hi,
    I am not proficient at VBA but need to use the documentation from "microsoft":http://msdn.microsoft.com/en-us/library/office/ff839342.aspx the documentation form msdn][1] to retrieve the number of pages in a word document.I have tried things like in the snippet below:

    @
    

    mWordDoc=new CustomQAxWidget("d:\gakwandi.docx",0);

     QAxObject* selection = mWordDoc->querySubObject( "Selection" );
    
     QAxObject* pageNumbers = selection ->querySubObject( "PageNumbers" );
    
     int numberOfPages = pageNumbers->property("Count").toInt();
    

    @

    But I am getting errors like

    • QAxBase::dynamicCallHelper: PageNumbers: No such property in d:\gakwandi.docx [unknown] Candidates are:....*.

    which suggests that I am somehow getting the syntax wrong somewhere.I was hopping someone more experienced with this would hep point out what I might be doing wrong.

    Thanks.

    Why join the navy if you can be a pirate?-Steve Jobs

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved