no save
Assistance
Achat
News

Forum | programmation
[macro openoffice] programmation d'un msgbox
lami20j, le jeu. 26 oct. 2006 à 21:15:37
Re,

REM ***** BASIC *****

Sub Main
' le msgbox retourne une valeur en fonction du bouton que tu utilises
' 1 pour ok
' 2 pour annuler
' à toi de découvrir le reste

dim repMsgBox as String

repMsgBox=msgbox("Hello, je suis MsgBox",1)


'maintenant on va utiliser le retour du msgbox
'donc en fonction du bouton utilisé on exécute quelque chose
if repMsgBox=1 then
msgbox "Vous avez cliquez sur OK"
elseif repMsgBox=2 then
msgbox "Vous avez cliques sur ANNULER"
end If
End SubEt dans ton cas REM ***** BASIC *****

Sub Main
' le msgbox retourne une valeur en fonction du bouton que tu utilises
' 1 pour ok
' 2 pour annuler
' à toi de découvrir le reste

dim repMsgBox as String

repMsgBox=msgbox("Voulez-vous continuer?",1,"Didier61 Macro")


'maintenant on va utiliser le retour du msgbox
'donc en fonction du bouton utilisé on exécute quelque chose
if repMsgBox=1 then
oDocument = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$B$26:$R$43"
dispatcher.executeDispatch(oDocument, ".uno:GoToCell", "", 0, args1())
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Copies"
args2(0).Value = 1
args2(1).Name = "Selection"
args2(1).Value = true
args2(2).Name = "Collate"
args2(2).Value = false
dispatcher.executeDispatch(oDocument, ".uno:Print", "", 0, args2())
elseif repMsgBox=2 then
msgbox "L'exécution a été annulée.",64,"Didier61 Macro"
exit sub
end If
End Sublami20j
PrécédentDidier61
oct. 06
Didier61
oct. 06
Suivant
REPONSES
lami20j
oct. 06
Didier61
oct. 06
lami20j
oct. 06
Didier61
oct. 06
-pyer
déc. 06
Didier61
déc. 06
Version Web
Réalisé par RedShift
no save