Search code examples
office365tooltipoffice-jsoffice-addinsribbonx

How do I change a tooltip at runtime?


The tooltip of a ribbon button is set in the manifest.xml file, which is a static file, but is it somehow possible to change the text in the tooltip of a command button in the ribbon at runtime?


Solution

  • Nope. The Office JavaScript API doesn't provide anything for that. There is no callback provided for the Supertip element, you need to specify them in the manifest. For example:

    <Supertip>
        <Title resid="funcReadSuperTipTitle" />
        <Description resid="funcReadSuperTipDescription" />
    </Supertip>
    

    The resid attribute can be no more than 32 characters and must be set to the value of the id attribute of a <String> element in the <LongStrings> element in the Resources element.

    You can post or vote for an existing feature request on Tech Community where they are considered when the Office dev team goes through the planning process.