Sub Add_AddIn() 'version Mac (peut être PC aussi pouvez vous confirmer SVP)
Dim addInPath As String
addInPath = "MonChemin/TEST.xlam"
AddIns.Add addInPath
AddIns("TEST").Installed = True '
End Sub
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<customUI azerty="http://schemas.microsoft.com/office/2009/07/customui" onLoad="CustomUIOnLoad">
<!--creatorRiBBonX application V 4.9.7 developed BY patricktoulon a 10-06-2023-->
<!--project Ribbon name :ryuauto-->
<ribbon startFromScratch="false">
<tabs>
<tab id="tab_1" label="Onglet Perso">
<group id="group_0" label="Groupe N° 1">
<!--ce splitbutton est d"ans un group l'attribut size est autorisé-->
<splitButton id="splitButton_1" size="large">
<!--cemenu est le conteneur des bouton du splitButton donc pas de label pas d icone-->
<menu id="menu_1" itemSize="large">
<button id="button_1" onAction="button_1_Click" imageMso="NameCreateFromSelection" label="toto" tag="toto"/>
<button id="button_2" onAction="button_2_Click" imageMso="PageBorderAndShadingDialog" label="titi" tag="titi"/>
<button id="button_3" onAction="button_3_Click" imageMso="SaveAll" label="riri" tag="riri"/>
</menu>
</splitButton>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
c'est un pb que je peux régler, mais on en reparlera en détails pour le splitButtonRegarde la pièce jointe 1174298
XML:<?xml version="1.0" encoding="utf-8" standalone="yes"?> <customUI azerty="http://schemas.microsoft.com/office/2009/07/customui" onLoad="CustomUIOnLoad"> <!--creatorRiBBonX application V 4.9.7 developed BY patricktoulon a 10-06-2023--> <!--project Ribbon name :ryuauto--> <ribbon startFromScratch="false"> <tabs> <tab id="tab_1" label="Onglet Perso"> <group id="group_0" label="Groupe N° 1"> <!--ce splitbutton est d"ans un group l'attribut size est autorisé--> <splitButton id="splitButton_1" size="large"> <!--cemenu est le conteneur des bouton du splitButton donc pas de label pas d icone--> <menu id="menu_1" itemSize="large"> <button id="button_1" onAction="button_1_Click" imageMso="NameCreateFromSelection" label="toto" tag="toto"/> <button id="button_2" onAction="button_2_Click" imageMso="PageBorderAndShadingDialog" label="titi" tag="titi"/> <button id="button_3" onAction="button_3_Click" imageMso="SaveAll" label="riri" tag="riri"/> </menu> </splitButton> </group> </tab> </tabs> </ribbon> </customUI>
Re Patrick,un autre exemple qui ressort souvent comme erreur
la gallery pas d'attribut getitemcount , getitemlabel si la gallery a des enfants <item>
les boutons size uniquement si c'est dans un group
menu itemsize à large pour grossir les boutons qui sont dedans
la comboBox pas de callback getitemID
les dropDown oui
voir les videos je montre les différences des deux même si elles se ressemblent
la comboBox et editbox le sizestring c'est en nombre de lettre et non en nombre
le split button pas de label pas d'icône
dynamicMenu getcontent e invalidatecontrolonDrop
le content c'est du code xml dynamique vba
et j'en passe et des meilleurs avec les autres call back
Je te rappelle que l'on fait un CustomUICreator pour Mac sans DomDocumentet il y en a un paquet de règles comme ça
tu crois toujours y arriver "avec une chaine string ?
<splitButton id="splitButton" size="large" >
<button id="button" imageMso="HappyFace" label="Split Button" />
<menu id="menu">
<button id="button1" label="Button 1" />
<button id="button2" label="Button 2" />
</menu>
</splitButton>
SuiteElems = Array("tab", "group", "button", "button", "splitButton", "menu", "button", "button", "splitButton", "menu", "button", "button")
tab | Vrai/Vrai
group | Vrai/Vrai
button | Vrai/Faux
button | Vrai/Faux
splitButton | Vrai/Vrai
menu | Vrai/Vrai
button | Vrai/Faux
button | Vrai/Faux
splitButton | Vrai/Vrai
menu | Vrai/Vrai
button | Vrai/Faux
button | Vrai/Faux
SuiteElems = Array("tab", "group", "button", "button", "splitButton", "button", "splitButton", "menu", "button", "button")
tab | Vrai/Vrai
group | Vrai/Vrai
button | Vrai/Faux
button | Vrai/Faux
splitButton | Vrai/Faux
button | Faux/Faux
splitButton | Faux/Vrai
menu | Vrai/Vrai
button | Vrai/Faux
button | Vrai/Faux
Sub getMyElements()
Dim inputList
'SuiteElems = Array("tab", "group", "button", "button", "splitButton", "button", "button", "group", "button", "separator", "button")
' SuiteElems = Array("tab", "group", "button", "button", "splitButton", "menu", "button", "button", "splitButton", "menu", "button", "button")
SuiteElems = Array("tab", "group", "button", "button", "splitButton", "button", "splitButton", "menu", "button", "button")
CheckElemUI SuiteElems, "tabs"
End Sub
Function CheckElemUI(ByVal arr As Variant, ByVal preElem As String)
Dim Elems As New ElemUI, getElemConteneur As New Collection, ElemsParents As String
ElemsParents = "ribbon | tabs | tab | group | box | buttonGroup | splitButton | menu | dynamicMenu | comboBox | dropDown | gallery"
For i = LBound(arr) To UBound(arr)
CheckP = Not IsError(Application.Match(preElem, Elems.GetParentElem(arr(i)), 0))
On Error Resume Next
CheckC = Not IsError(Application.Match(arr(i + 1), Elems.GetChildElem(arr(i)), 0))
If Err Then
CheckC = False
End If
On Error GoTo 0
If ElemsParents Like "*| " & arr(i) & " |*" Then
If getElemConteneur.Count = 0 Then
getElemConteneur.Add arr(i), arr(i)
Else
On Error Resume Next
getElemConteneur.Add arr(i), arr(i), preElem
If Err Then
getElemConteneur.Remove arr(i)
getElemConteneur.Add arr(i), arr(i), preElem
End If
On Error GoTo 0
End If
End If
Debug.Print arr(i) & " | " & CheckP & "/" & CheckC
preElem = getElemConteneur.Item(1)
Next
End Function
Option Explicit
Private parentElem As Collection
Private childElem As Collection
Public Function GetParentElem(ByVal key As String) As Variant
GetParentElem = parentElem(key)
End Function
Public Function GetChildElem(ByVal key As String) As Variant
GetChildElem = childElem(key)
End Function
Private Sub Class_Terminate()
Set parentElem = Nothing
Set childElem = Nothing
End Sub
Private Sub Class_Initialize()
Set parentElem = New Collection
Set childElem = New Collection
parentElem.Add Array("ribbon"), "tabs"
parentElem.Add Array("tabs"), "tab"
parentElem.Add Array("tab"), "group"
parentElem.Add Array("group", "box"), "box"
parentElem.Add Array("group", "box"), "buttonGroup"
parentElem.Add Array("group", "box", "buttonGroup", "menu", "splitButton"), "menu"
parentElem.Add Array("buttonGroup", "menu"), "dynamicMenu"
'parentElem.Add Array("group", "box", "buttonGroup", "dropDown", "gallery", "menu", "splitButton"), "button"
parentElem.Add Array("group", "box", "buttonGroup", "dropDown", "gallery", "menu"), "button"
parentElem.Add Array("group", "box", "buttongroup", "menu"), "splitButton"
parentElem.Add Array("group", "box", "menu"), "checkBox"
parentElem.Add Array("group", "box"), "comboBox"
parentElem.Add Array("group", "box"), "dropDown"
parentElem.Add Array("group", "box", "buttonGroup", "menu"), "gallery"
parentElem.Add Array("comboBox", "dropDown", "gallery"), "item"
parentElem.Add Array("group", "box"), "labelControl"
parentElem.Add Array("group"), "separator"
parentElem.Add Array("menu"), "menuSeparator"
childElem.Add Array("tabs"), "ribbon"
childElem.Add Array("tab"), "tabs"
childElem.Add Array("group"), "tab"
childElem.Add Array("box", "button", "buttonGroup", "checkBox", "comboBox", "control", "dialogBoxLauncher", "dropDown", "dynamicMenu", "editBox", "gallery", "labelControl", "menu", "separator", "splitButton", "toggleButton"), "group"
childElem.Add Array("box", "button", "buttonGroup", "checkBox", "comboBox", "control", "dropDown", "dynamicMenu", "editBox", "gallery", "labelControl", "menu", "splitButton", "toggleButton"), "box"
childElem.Add Array("button", "control", "dynamicMenu", "gallery", "menu", "splitButton", "toggleButton"), "buttonGroup"
childElem.Add Array("menu"), "splitButton"
'childElem.Add Array("button", "menu", "toggleButton"), "splitButton"
childElem.Add Array("button", "checkBox", "control", "dynamicMenu", "gallery", "menu", "menuSeparator", "splitButton", "toggleButton"), "menu"
childElem.Add Array("button", "checkBox", "control", "dynamicMenu", "gallery", "menu", "menuSeparator", "splitButton", "toggleButton"), "dynamicMenu"
childElem.Add Array("item"), "comboBox"
childElem.Add Array("button ", "item"), "dropDown"
childElem.Add Array("button ", "item"), "gallery"
End Sub
Private indentation As Integer
Private IndentationSpace As Integer
Public Sub Initialize(ByVal space As Integer)
indentation = 0
IndentationSpace = space
End Sub
Public Sub IncreaseIndentation()
indentation = indentation + IndentationSpace
End Sub
Public Sub DecreaseIndentation()
If indentation >= IndentationSpace Then
indentation = indentation - IndentationSpace
End If
End Sub
Public Function GetCurrentIndentation() As String
GetCurrentIndentation = space(indentation)
End Function
Re Patrick,re
perso je veux bien mais pour la suite tu te heurte à plein de choses
et comme je le dis dans la vidéo tu va droit dans le mur
je te fait les fonctions passerelles getElementById voir même la fonction getElementsBytagname
et je te donnerais le fichier