Office.Addin interface 
表示用于作或配置加载项的各个方面的外接程序级别功能。
注解
要求集: SharedRuntime 1.1
属性
| before | 表示可在用户尝试关闭文档时显示的模式通知对话框。 在用户响应之前,文档不会关闭。 此 API 仅在 Excel 中受支持。 | 
方法
| get | 获取加载项的当前启动行为。 | 
| hide() | 隐藏任务窗格。 | 
| on | 为 事件添加处理程序  | 
| set | 为下次打开文档时设置加载项的启动行为。 | 
| show | 显示与加载项关联的任务窗格。 | 
属性详细信息
		beforeDocumentCloseNotification
	   
	表示可在用户尝试关闭文档时显示的模式通知对话框。 在用户响应之前,文档不会关闭。 此 API 仅在 Excel 中受支持。
beforeDocumentCloseNotification: BeforeDocumentCloseNotification;属性值
注解
要求集: SharedRuntime 1.2
方法详细信息
		getStartupBehavior()
	  
	获取加载项的当前启动行为。
getStartupBehavior(): Promise<Office.StartupBehavior>;返回
Promise<Office.StartupBehavior>
注解
要求集: SharedRuntime 1.1
hide()
		onVisibilityModeChanged(handler)
	   
	为 事件添加处理程序 onVisibilityModeChanged 。
onVisibilityModeChanged(
            handler: (message: VisibilityModeChangedMessage) => void,
        ): Promise<() => Promise<void>>;参数
- handler
- 
				(message: Office.VisibilityModeChangedMessage) => void 
发出事件时调用的处理程序函数。 此函数接收接收组件的消息。
返回
Promise<() => Promise<void>>
一个承诺,在添加处理程序时解析为函数。 调用它将删除处理程序。
注解
要求集: SharedRuntime 1.1
示例
Office.onReady(() => {
    Office.addin.onVisibilityModeChanged((args) => {
        if (args.visibilityMode === Office.VisibilityMode.taskpane) {
            // Do something when the task pane is visible.
        }
    });
    // Other startup tasks.
});
		setStartupBehavior(behavior)
	  
	为下次打开文档时设置加载项的启动行为。
setStartupBehavior(behavior: Office.StartupBehavior): Promise<void>;参数
- behavior
- Office.StartupBehavior
指定加载项的启动行为。
返回
Promise<void>
注解
要求集: SharedRuntime 1.1
示例
// Configure your add-in to load and start running when the document is opened.
Office.addin.setStartupBehavior(Office.StartupBehavior.load);
		showAsTaskpane()
	 
	显示与加载项关联的任务窗格。
showAsTaskpane(): Promise<void>;返回
Promise<void>
显示 UI 时解析的承诺。
注解
要求集: SharedRuntime 1.1