Results 1 to 2 of 2

Thread: Static Ribbon Controlling

  1. #1

    Static Ribbon Controlling



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello everyone,
    I have this xml and vba code for dynamic menu in to ribbon,everything works perfect except i need to make it static (if you use c,c++ or java you know what i mean) to put more buttons dynamically
    HTML Code:
    <dynamicMenu id="dynTabMenu" 
    label="Modells"
    imageMso="CreateTable"
    size="large"
    getContent="dynTabMenu_getContent"/>
    
    </group>
    

    Code:
    Private Sub dynTabMenu_getContent(control As IRibbonControl, ByRef returnedVal)
    Dim strXML As String, strLabel As String, strTag As String
    Dim wks As Worksheet
    Dim strn As String
    Dim lastcolumn As Double
    strn = Range("C11").Value
    On Error GoTo Fehler
      strXML = "<menu xmlns=""http://schemas.microsoft.com/office/2006/01/customui"">" & vbLf
      
      For Each wks In ThisWorkbook.Worksheets
        strTag = Mask(strn, False)
        strLabel = Mask(strn, True)
        
        If wks.Visible = True Then
          strXML = strXML & "<button id=""" & strn & """" _
                                 & " label=""" & strn & """" _
                                 & " tag=""" & strn & """" _
                                 & " onAction=""gallipolli""/>" & vbLf
        Else
          strXML = strXML & "<button id=""" & strn & """" _
                                 & " label=""" & strn & """" _
                                 & " tag=""" & strn & """" _
                                 & " screentip=""mein kleiner Screentip""" _
                                 & " supertip=""Diese Tabelle ist nicht sichtbar!""" _
                                 & " imageMso=""StopLeftToRight""" _
                                 & " onAction=""gallipolli""/>" & vbLf
        End If
      Next wks
      
      strXML = strXML & "</menu>"
      returnedVal = strXML
    Exit Sub
    Fehler:
      MsgBox "Fehler in: dynTabMenu_getContent" & vbLf & _
             Err.Description, vbCritical, "Fehler!"
    End Sub

    Best Regards

  2. #2
    Conjurer WizzardOfOz's Avatar
    Join Date
    Sep 2013
    Location
    Australia
    Posts
    184
    Articles
    0
    I'm just learning about these too. Good luck!
    Try these two links http://www.excelguru.ca/blog/2007/01...nu-an-example/ and http://gregmaxey.mvps.org/word_tip_p...bbon_menu.html there's a worked example about 3/4 of the way down

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •