I am not proficient at VBA but need to use the documentation from microsoft the documentation form msdn 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 windows programming would hepl point out what I might be doing wrong.
Thanks.