none
Create gallery with images in Excel RRS feed

  • Question

  • I am trying to make smth like this: 

    For now I use the imageMso attribute just for testing purposes. Even though, nothing really happens.

    That's the XML for the gallery:

     <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
        <tabs>
          <tab idMso="TabAddIns" label="Gallery">
            <group id="grpGallery" label="Example Gallery">
              <gallery id="galleryID" label="My Gallery" columns="3" rows="2" size="large"
                       itemHeight="100" itemWidth="100"
                       getItemID="CallbackGetItemID"
                       getItemCount="CallbackGetItemsCount"
                       getItemImage="CallbackGetItemImage"
                       getItemScreentip="CallbackGetItemScreentip"
                       getItemSupertip="CallbackGetItemSupertip">
                <item id="galImg1" imageMso="PictureBrightnessGallery"/>
                <item id="galImg2" imageMso="ZoomPrintPreviewExcel"/>
              </gallery>
    
    ....

    And the VB code to it:

     Public idCounter As Integer
    
        Public Sub New()
            idCounter = 0
        End Sub
    
        Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtensibility.GetCustomUI
            Return GetResourceText("GalleryTest.Gallery.xml")
        End Function
    
    #Region "Ribbon Callbacks"
        Public Sub Ribbon_Load(ByVal ribbonUI As Office.IRibbonUI)
            Me.galleryRibbon = ribbonUI
        End Sub
    
        Public Sub CallbackGetItemID(control As Microsoft.Office.Core.IRibbonControl, _
                                     index As Integer, ByRef itemID As Integer)
            itemID = idCounter
            idCounter += 1
        End Sub
    
        Public Sub CallbackGetItemsCount(control As Microsoft.Office.Core.IRibbonControl, _
                                            ByRef count As Integer)
            count = 6
        End Sub
    
        Public Sub CallbackGetItemScreentip(control As Microsoft.Office.Core.IRibbonControl, _
                                            Index As Integer, ByRef screentip As String)
            screentip = "Screentip"
        End Sub
    
        Public Sub CallbackGetItemSupertip(control As Microsoft.Office.Core.IRibbonControl, _
                                           Index As Integer, ByRef supertip As String)
            'TO DO'
        End Sub

    As you see, it's nothing fancy. I am just getting into the vb.net + excel world. What happens is that I get the "My Gallery" button for the dropdown, in the excel tab, but it is empty. No elements. Not even the dummy items.

    Any suggestions?

    P.S. I followed this documentation.


    Thursday, February 5, 2015 2:46 PM

Answers

All replies