Office.DialogParentMessageReceivedEventArgs interface
提供有关引发事件的父页中的 DialogParentMessageReceived 消息的信息。
若要为 DialogParentMessageReceived 事件添加事件处理程序,请使用 addHandlerAsyncOffice.UI 对象的 方法。
注解
示例
// The following example provides information about the message from the parent page.
Office.onReady(() => {
Office.context.ui.addHandlerAsync(Office.EventType.DialogMessageReceived, onMessageFromParent);
});
function onMessageFromParent(args: Office.DialogParentMessageReceivedEventArgs) {
const eventType = args.type;
const origin = args.origin;
const messageFromParent = args.message;
console.log(`${eventType} event occurred. Message received from ${origin}: ${messageFromParent}`);
}
属性
| message | 获取从父页发送的消息的内容,该页可以是任何字符串或字符串化数据。 |
| origin | 获取调用 |
| type | 获取一个 Office.EventType 枚举值,该值标识引发的事件类型。 |
属性详细信息
message
获取从父页发送的消息的内容,该页可以是任何字符串或字符串化数据。
message: string;
属性值
string
origin
获取调用 Dialog.messageChild的父页的域。
origin: string | undefined;
属性值
string | undefined
注解
要求集: DialogOrigin 1.1。 属性位于 undefined 不支持此要求集的客户端上。