Vielleicht ist das eine ganz simple Frage und jemand kann mir hier schneller helfen als in einem Macro-Forum ...
Also, mein Makro soll einen simplen Text einfügen (hier |A|), allerdings beispielsweise fett. Die simple Struktur unten hätte ich schon, aber wie bringt man Attribute hinein?
Vielen Dank im Voraus.
Z.
Code: Alles auswählen
Sub Test
Dim oDoc As Object
Dim oText As Object
Dim oVCurs As Object
Dim oTCurs As Object
Dim oString As String
oDoc = ThisComponent
oText = oDoc.Text
oVCurs = oDoc.CurrentController.getViewCursor()
oTCurs = oText.createTextCursorByRange(oVCurs.getStart())
' Place the text to insert here
oString = "|A|"
oText.insertString(oTCurs, oString, FALSE)
End Sub