Delphi and WordBasic (OLE)

Hi all,

I experienced a problem calling a WordBasic function in my Delphi app :

I want to get the number of pages in a document. The function is (in french

        Nb_Pages := FSessionWord.LitPropritDocument('Pages')                

It's working well when I put a break point on the line, but when it goes by
itself, the function is not finished and go trough the rest of the code.

The result is that there's not enough time to read all the pages (it's always  
give me only one page but in reality there's more).

If someone have an idea on how I can let WordBasic the time to query without
steping to fast to the next line ...

Thank you.

Dominic Vaillancourt