von MurDoGG » Mo, 20.08.2007 12:33
Hallo
ich füge in ein Writer Dokument über folgenden Befehl Text ein:
Code: Alles auswählen
Sub InsertText(sValue As String, sFontName As String, sHeight As String, sWeight As String, sULine As String)
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
oController = oDesktop.CurrentFrame.Controller
oDocument = oController.Model
oDocument.supportsService( "com.sun.star.text.TextDocument" )
oSelection = oDocument.CurrentSelection( 0 )
oSelection.CharFontName = sFontName
oSelection.CharHeight = sHeight
oSelection.CharWeight = sWeight
oSelection.Text.insertString( oSelection, sValue, True )
End Sub
Ich würde die Formatierung aber gerne nicht "hart" machen, sonder die Formatvorlagen benutzen. Hat jemand eine Idee wie das in OO funktioniert.
Mfg
Sebastian
Hallo
ich füge in ein Writer Dokument über folgenden Befehl Text ein:
[code]Sub InsertText(sValue As String, sFontName As String, sHeight As String, sWeight As String, sULine As String)
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
oController = oDesktop.CurrentFrame.Controller
oDocument = oController.Model
oDocument.supportsService( "com.sun.star.text.TextDocument" )
oSelection = oDocument.CurrentSelection( 0 )
oSelection.CharFontName = sFontName
oSelection.CharHeight = sHeight
oSelection.CharWeight = sWeight
oSelection.Text.insertString( oSelection, sValue, True )
End Sub
[/code]
Ich würde die Formatierung aber gerne nicht "hart" machen, sonder die Formatvorlagen benutzen. Hat jemand eine Idee wie das in OO funktioniert.
Mfg
Sebastian