Con questa macro (generata con il registratore di macro) associata all’evento Approva l'azione
di un pulsante, viene ordinato un elenco nell’intervallo A1:A15:
Se la mia riposta ti ha aiutato, votala con (qui a sinistra)
sub Main
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 = "$A$1:$A$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(9) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ByRows"
args2(0).Value = true
args2(1).Name = "HasHeader"
args2(1).Value = false
args2(2).Name = "CaseSensitive"
args2(2).Value = false
args2(3).Name = "NaturalSort"
args2(3).Value = false
args2(4).Name = "IncludeAttribs"
args2(4).Value = true
args2(5).Name = "UserDefIndex"
args2(5).Value = 0
args2(6).Name = "Col1"
args2(6).Value = 1
args2(7).Name = "Ascending1"
args2(7).Value = true
args2(8).Name = "IncludeComments"
args2(8).Value = false
args2(9).Name = "IncludeImages"
args2(9).Value = true
dispatcher.executeDispatch(document, ".uno:DataSort", "", 0, args2())
end sub