Code: Alles auswählen
sub ORT
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$D$13"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Format"
args2(0).Value = 1
dispatcher.executeDispatch(document, ".uno:PasteSpecial", "", 0, args2())
x = ThisComponent.getCurrentSelection
x1 = x(0).Text.CreateTextCursor
k = Split(x1.String, CHR(13))
k1 = ""
For i = 0 To UBOUND(k())
If LEN(k(i)) > 1 Then
k1 = k1 & k(i) & CHR(13)
End If
Next i
tmp = LEN(k1)
k1 = LEFT(k1, tmp-1) 'letztes CHR(13) weg
x1.String = k1
end Sub
Stephan