[Résolu][Calc] Utilisation d'un "loop" (boucle)
Publié : 02 janv. 2020 12:32
Bonjour,
Je me permets de vous contacter car je n'arrive pas à utiliser la fonction loops sur les macros (je n'ai pas compris en lisant les tuto "basic guide").
Voici ci-dessous la fonction nommer "bloc de commande" que je souhaite dupliquer jusqu'à la fin du document:
Quelle ligne de code dois-je rajouter ?
Merci d'avance pour votre retour.
Je me permets de vous contacter car je n'arrive pas à utiliser la fonction loops sur les macros (je n'ai pas compris en lisant les tuto "basic guide").
Voici ci-dessous la fonction nommer "bloc de commande" que je souhaite dupliquer jusqu'à la fin du document:
Code : Tout sélectionner
REM ***** BASIC *****
sub Main
rem define variables
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem bloc de commande
dispatcher.executeDispatch(document, ".uno:SelectCell", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Cut", "", 0, Array())
dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "By"
args3(0).Value = 1
args3(1).Name = "Sel"
args3(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args3())
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:GoUp", "", 0, args4())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
dim args6(1) as new com.sun.star.beans.PropertyValue
args6(0).Name = "By"
args6(0).Value = 1
args6(1).Name = "Sel"
args6(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args6())
dim args7(1) as new com.sun.star.beans.PropertyValue
args7(0).Name = "By"
args7(0).Value = 1
args7(1).Name = "Sel"
args7(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args7())
dim args8(1) as new com.sun.star.beans.PropertyValue
args8(0).Name = "By"
args8(0).Value = 1
args8(1).Name = "Sel"
args8(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args8())
dim args9(1) as new com.sun.star.beans.PropertyValue
args9(0).Name = "By"
args9(0).Value = 1
args9(1).Name = "Sel"
args9(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args9())
dim args10(1) as new com.sun.star.beans.PropertyValue
args10(0).Name = "By"
args10(0).Value = 1
args10(1).Name = "Sel"
args10(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args10())
rem ----------------------------------------------------------------------
rem ----------------------------------------------------------------------
end subMerci d'avance pour votre retour.