简体   繁体   中英

Define a custom function in Office.js add-in with React

I'm quite new working with the Office.js API. I created a React add-in project and I'm now trying to add a custom function which can simply add two cells just like the examples at create custom function in Excel . In this guide it says you have to create the add-in project as Excel Custom Functions

So my doubt is how can I create a custom function if the add-in project I created is React type instead of Excel Custom Functions

yes you definitely can. Currently it means merging existing templates (react template and the one at custom functions template which are both available via yo office) and as feature moves out of preview we will have explicit guidance on https://aka.ms/customfunctions .

For now there are 4 things: a) modify your manifest to add the customfunctions under the “allformfactors” element b) add an customfunctions.html file which can load your JavaScript c) add the customfunctions.json file d) add a reference to your JavaScript

Hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM