The code you have is to know whether changing pages succeeded or not, and unless you are trying to set a page number that is out of the page count it will always succeed
So, yes, your test is the same as if (false)
Now, page loading is done in an asynchronous manner
1. you ensure that the page (the container for all the page artifacts) is created, synchronously
2. the page content are streamed on another thread
3. once the page is loaded, an event is sent VueEvent(VueEvent.FILEEVENT, VueEvent.ONPAGELOADED)
So you should be able to query for info after you received the page loaded event
Now, word documents are an special kind of documents, so you need to be aware of some specific issues.
The same way ms-word does not know the total number of pages until the ENTIRE document is loaded, AutoVue will not be able to notify you either.
And as Word, AutoVue allows you to display the pages that are already loaded, and you may query for some of its contents too. BUT you can not query for page info when the page is been loaded (or obviously not yet loaded)
The loading is a 2 phase one, part is done on the server (native code) and part is on the java side (display)
So you will not be able to iterate
for( curPage = 1; curPage <= pages; curPage++)
simply because page count is not known. You need to query doc info more than once.
If page count = -1, you need to iterate for each page and then, test whether setPage() != getPage() and/or page count has been updated.