Bonjour
Dans le but de rendre plus lisible une macro de traitement dans calc, je voudrais remplacer des séquences du type
Preformatted text
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = “By”
args1(0).Value = 1
args1(1).Name = “Sel”
args1(1).Value = false
dispatcher.executeDispatch(document, “.uno:GoDown”, “”, 0, args1())
Preformatted text
par l’appel d’une subroutine, _GoDown
J’ai fait plusieurs essais, sans succès, par exemple
`Preformatted text`
sub Main
.
.
.
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")
.
.
.
_GoDown(document, dispacher)¨.
.
.
end sub
sub _GoDown(pDocument as object,pDispacher as object)
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 1
args1(1).Name = "Sel"
args1(1).Value = false
pDispatcher.executeDispatch(pDocument, ".uno:GoDown", "", 0, args1())
end sub
Preformatted text
Pouvez-vous me proposer un modèle pour répondre à ce genre de besoin?
Jean