Jump to content

Macros/Writer/ba001/nl

From The Document Foundation Wiki
This page is a translated version of the page Macros/Writer/ba001 and the translation is 100% complete.


Beschrijving

Voeg een tekenreeks in op de cursorpositie in het huidige document.

Basic code

Sub insert_in_cursor_position()
    data = "Hello World with Basic"

    REM Huidige document
    doc = ThisComponent

    REM De huidige selectie retourneert altijd een bereik en loopt tot het eind
    text = doc.CurrentSelection.getByIndex(0).End
    
    REM Gegevens schrijven
    text.String = data    
End Sub


References to API

Regel Link
5 com.sun.star.text.TextDocument
8, 11 com.sun.star.text.XTextRange