问题
I have an add-in working (on Word for Mac). All functionality runs in the background, so there is no interaction with the UI exposed in the taskpane. However, if I close the taskpane, the add-in functionality is removed.
Is there a way to remove the taskpane so that the add-in functionality will run in the background? Currently, the taskpane is just a waste of screen space...
Thanks for any help!
回答1:
There's no way of doing that unfortunately. Suresh's answer is referring to Function Files and add-in commands, but that requires manual invocation and doesn't support the background tasks.
That means - if you want a user action to do something but no real UI is needed / Functions are the way to go. But if you want a background process running (checking if something has changed periodically) - you'll need the TaskPane.
回答2:
You can make your add-in as UI-less add-in, which runs in background. Here is the documentation on types of app commands (add-in buttons). If your HTML file is empty already, change the action type from ShowTaskpane to ExecuteFunction. Include the HTML link as FunctionFile and add a function, which can handle the event argument.
来源:https://stackoverflow.com/questions/55943972/run-add-in-without-showing-taskpane