none
Word Add-in : Ribbon XML : Enable the button of the splitbutton. RRS feed

  • Question

  • Hi peepz,

    I'm developping a ribbon for word, it works fine but i would like to give it a slightly cleaner look.

    The overall idee :

    My ribbon has multiple groups (personal data, company data,...).
    In the personal data i have 4 splitbuttons with a menu.

    below you can find the XML code.

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
     
      <ribbon>
        <tabs>
          <tab idMso="TabAddIns" label="CV">
            <group id="grpPersonalData" getSupertip="GetSuperTip" getImage="GetImage" getLabel="GetLabel" >
              <splitButton id="splPDGeneral" size="large">
                <button id="splPDGeneral__btn" enabled="false" getSupertip="GetSuperTip" getScreentip="GetScreenTip"    getLabel="GetLabel" getImage="GetImage"/>
                  <menu id="splPDGeneral__mnu"  getSupertip="GetSuperTip" >
                  <button id="btnPDTitle"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"    onAction="btnPDTitle_Click" getImage="GetImage" getLabel="getLabel"  />
                  <button id="btnPDLastName"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"    getLabel="GetLabel" onAction="btnPDLastName_Click" getImage="GetImage" />
                  <button id="btnPDFirtsName"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"    getLabel="GetLabel" onAction="btnPDFirtsName_Click" getImage="GetImage" />
                  <button id="btnPDDOB"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"    getLabel="GetLabel"  onAction="btnPDDOB_Click" getImage="GetImage"/>
                  <button id="btnPDNat"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"     getLabel="GetLabel" onAction="btnPDNat_Click" getImage="GetImage" />
                  <button id="btnPDGender"  getSupertip="GetSuperTip" getScreentip="GetScreenTip"    getLabel="GetLabel"  onAction="btnPDGender_Click" getImage="GetImage" />
                </menu>
              </splitButton>
    </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    now what i would like to have is that the button part (underlined) of a splitbutton is a unclickable button.

    the only way i can think of is by disabling the button but than it gets that dirty grey look.

    Is there a possibility to make this button unclickable?

    thanks peepz

    Wednesday, May 23, 2012 1:49 PM

Answers

  • Hi peepz

    Why not have the onAction procedure simply an "empty" one, that does nothing?


    Cindy Meister, VSTO/Word MVP

    Wednesday, May 23, 2012 2:39 PM
    Moderator