You are here:   dynamicMenu - getContent

dynamicMenu - getContent

 

getContent

Sets the XML String of a Ribbon Control that describes the menu.








Sample Ribbon XML file:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="false">
        <tabs>
            <tab id="MyTab" label="Demo">
                <group id="MyGroup" label="Demo">
                    <labelControl id="myLabel1" label="Sample:" />
                    <labelControl id="myLabel2" label="Menu" />
                    <menu id="MyMenu" label="Sample Menu" 
                      itemSize="normal">
                        <dynamicMenu id="MyDynamicMenu" 
                          label="Dynamic Menu" 
                          getContent="CallbackGetContent"/>
                    </menu>
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>  

Function to be copied to a standard module:

Sub CallbackGetContent(control As IRibbonControl, _
                       ByRef XMLString)
    ' Callback getContent
 
    Dim lngDummy    As Long
    Dim strDummy    As String
    Dim strContent  As String
    strDummy = "<menu xmlns=""http://schemas.microsoft"
    strDummy = strDummy & ".com/office/2006/01/customui"">"
    
        For lngDummy = 0 To 5
            strContent = strContent & _
            "<button id=""MyDynaButton" & lngDummy & _
            """ label =""Dynamic Item" & _
            lngDummy & """/>"
        Next
 
    strDummy = strDummy & strContent & " </menu>"
    XMLString = strDummy
End Sub


You can find this sample in Sample DB 2



Back

Last Updates:

25.10.2018
Update Site "Trusted Locations" ...

22.10.2018
New Download added. ...

08.04.2018
IDBE RibbonCreator 2016 (x86 and x64) for Office 2013 and Office 2016 - new release. ...

04.08.2017
Add new Link. ...

 

Last update: