Jump to content

Macros/Writer/ba001/es

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


Descripción

Inserta una cadena de texto en la posición del cursor en el documento en pantalla.

Código Basic

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

    REM Documento actual
    doc = ThisComponent

    REM '''"Current selection"''' siempre devuelve intervalos y con ".end" obtiene el final
    text = doc.CurrentSelection.getByIndex(0).End
    
    REM Escribir datos
    text.String = data    
End Sub


References to API

Línea Enlace
5 com.sun.star.text.TextDocument
8, 11 com.sun.star.text.XTextRange