|sub insertionformulenature|
||
|
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 = "tetenature" rem "$J$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0,
args1())
rem
----------------------------------------------------------------------
dim args2(1) as new com.sun.star.beans.PropertyValue
args2(0).Name = "By"
args2(0).Value = 1
args2(1).Name = "Sel"
args2(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData",
"", 0, args2())
rem -------repérer la ligne de la cellule active
Dim CelluleActive As Object, LigneCelluleActive As Variant
CelluleActive = ThisComponent.getCurrentSelection
LigneCelluleActive= CelluleActive.CellAddress.Row
rem
----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "By"
args3(0).Value = 1
rem dispatcher.executeDispatch(document, ".uno:GoUpSel", "", 0,
args3())
dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0,
args3())
dispatcher.executeDispatch(document,
".uno:JumpToNextUnprotected", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:FillDown", "", 0,
Array())
rem
----------------------------------------------------------------------
dim args4(1) as new com.sun.star.beans.PropertyValue
args4(0).Name = "By"
args4(0).Value = 1
args4(1).Name = "Sel"
args4(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0,
args4())
end Sub|