Hi *, 
hi Max,

Search options chosen on the "Search" dialog are made persistent, so do a 
search checking to search also in Notes.
Then run the following code:

Sub Main
        Dim oDoc
        oDoc = ThisComponent 'well... I simply suppose it's a Writer doc
        
        Dim oNote
        oNote = oDoc.createInstance("com.sun.star.text.textfield.Annotation")
        oNote.Author = "Homer J. Simpson"
        oNote.Content = "This is a demo"
        
        Dim oCursor
        oCursor = oDoc.getText().createTextCursor()
        oCursor.goToEnd(false)
        
        oDoc.getText().insertTextContent( oCursor, oNote, false )
End Sub

A window pops up after insertTextContent(), with the message:
"Continue checking at beginning of document?"

That is, a search is performed automatically after inserting the note via API.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to