office-js-dev Office.actions missing

Lourens Groenewald 1 Reputation point
2021-09-06T11:24:52.91+00:00

Hi

When looking at the documentation when wanting to create shortcuts it is showing the below code

Office.actions.associate('SHOWTASKPANE', function () {
    return Office.addin.showAsTaskpane()
        .then(function () {
            return;
        })
        .catch(function (error) {
            return error.code;
        });
});

I am getting the following error:
Property 'actions' does not exist on type 'typeof Office'

was actions removed from the js library?

I cannot seem to get it working

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
881 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chris Drake 96 Reputation points
    2021-09-10T13:00:08.257+00:00

    The taskpane is an HTML file that is loaded from your web server when the user clicks the taskpane button for your add-in.
    You specify where that HTML file lives, and the icon for the button, inside your manifest.xml file.

    Take a look at the Script Lab add-in for example.

    0 comments No comments