How do I Set a Descripition to a Button on my Ribbon

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hila levi
    New Member
    • Mar 2012
    • 1

    How do I Set a Descripition to a Button on my Ribbon

    I have new ribbon, that has a few buttons.
    How am I add descripition to the new buttons I add?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    I don't have ribbons as I still use 2003, but whoever considers answering this question will need to know if you are creating the ribbon via the interface or code.

    Comment

    • Hennepin
      New Member
      • Oct 2009
      • 25

      #3
      I do not believe there is an interface for creating a ribbon in Access 2007. I use the system table ‘USysRibbons’ method of loading ribbons, described in this link http://www.accessribbon.de/en/?Access_-_Ribbons
      I am guessing by description you mean label. the XML code for creating a button with a label is
      Code:
      <button id="MybuttonID" label="My Label" screentip="My Screen Tip" onAction="MyOnActionButton"/>

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        As you've provided the XML code, maybe you'd like to explain how it's used. It's not typical (in my experience) to use XML when developing in VBA.

        Comment

        • Stewart Ross
          Recognized Expert Moderator Specialist
          • Feb 2008
          • 2545

          #5
          @NeoPa, customising the ribbon is done in XML, and is far from a simple task - and nor is it something straightforward to explain.

          This MSDN article is an introduction to Customising the Fluent Ribbon.

          -Stewart

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            1. The USysRibbons Table must be created and consist of at least the following 3 Fields:
              1. [ID] - AutoNumber - LONG
              2. RibbonName - TEXT {255}
              3. RibbonXML - MEMO
            2. The XML Code is dumped initp the RibbonXML Field like so:
              Code:
              <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
                <ribbon startFromScratch="false">
                  <tabs>
                    <tab idMso="TabCreate" visible="false" />
                    <tab id="dbCustomTab" label="A Custom Tab" visible="true">
                      <group id="dbCustomGroup" label="A Custom Group">
                        <control idMso="Paste" label="Built-in Paste" enabled="true"/>
                      </group>
                    </tab>
                  </tabs>
                </ribbon>
              </customUI>
            3. The XML Code first instructs Access not to 'start from scratch' — that is, it specifies that Access should display the default Ribbon Tabs. Then, it tells Access to hide just one of the default Tabs (the Create tab). Finally, it creates a new Ribbon Tab named 'A Custom Tab', adds a Command Group named 'A Custom Group' to the Tab, and adds the Paste command to the Group.
            4. Close the USysRibbons Table, and then close and reopen the Database.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32653

              #7
              Thanks guys. That's very illuminating.

              I won't divert the thread off track, but I will comment that I look forward to looking into this more when I upgrade. Looks like fun, and your example, ADezii, brought the idea home in a way that articles can't easily.

              Comment

              Working...