Thanks Fernand,

This is my code to search:

            controller=doc.getCurrentController()
            cursor=controller.getViewCursor()
            xSearchDescr = doc.createSearchDescriptor()
            xSearchDescr.SearchString = "term to search"
            xSearchDescr.SearchCaseSensitive = 0
            xSearchDescr.SearchWords = 0
            xFound = doc.findFirst( xSearchDescr )
            i=0
            while xFound>0:
                 nbpage=cursor.getPage()
                 print "%d:%d"%(i,nbpage)
                 i=i+1
                 xFound = doc.findNext( xFound.End, xSearchDescr )

However the page displayed is always 1.
What is the Thiscomponent you are referring to, is it my Doc or is it the 
SearchDescriptor ?

Thanks !

Laurent

Crivello, Laurent wrote:
> Dear All,
>
> I have a bit of code to search multiple instances of a string in a writer 
> document.
> This works fine.
> However I would now like to find out at which page number these strings 
> appear.
>
The Viewcursor kwows the page
with the Api  >>> Thiscomponent.currentcontroler.ViewCursor.page

Hope it helps

Fernand
> How can I find this ?
>
> Thanks for your help,
> Laurent
>
>
>

Reply via email to