Bonjour,
voici pour afficher les boutons avec un fond de cellule qui change
Sub AfficherBoutonsOoo
Call CouleurDoubleMagenta6()
dim oDoc as object, oViewCtrl as object, oViewCtrl2 as object, oFeuille as object
dim oForm as object, oView as object, Btn1 as object, Btn2 as object, Btn3 as object
oDoc = thiscomponent 'le document courant
oView = oDoc.currentcontroller() 'en gros la fenêtre dans laquelle se trouve le document
oFeuille = oDoc.sheets.getByName("Passions") 'la feuille
oForm = oFeuille.drawpage.getforms().getbyname("Formulaire") 'pointe sur le formulaire principal dans la feuille
Btn1 = oForm.getbyname("BtnCoursPerso")
Btn2 = oForm.getbyname("BtnMacro")
Btn3 = oForm.getbyname("BtnLien")
Btn1.EnableVisible = True
Btn2.EnableVisible = True
Btn3.EnableVisible = True
End Sub
sub CouleurDoubleMagenta6
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 = "$F$14:$G$27"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "BackgroundColor"
args2(0).Value = 6684774
dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, args2())
end Sub