如何以编程方式在 PowerPoint 的 JavaScript 加载项中触发演示模式?
How to programmatically trigger presentation mode in JavaScript add-in for PowerPoint?
我们有一种方法可以检查 PowerPoint 文档的当前状态:https://msdn.microsoft.com/EN-US/library/office/dn482495.aspx
Document.getActiveViewAsync
我也可以监听状态的变化:https://msdn.microsoft.com/EN-US/library/office/dn482501.aspx
ActiveViewChanged event
我已经在使用如下:
var _hideArrowInPresentationMode = function(e) {
var presentationMode = (e.activeView === "read"); // can inline variable but I find 'presentationMode' more descriptive
if (presentationMode) {
$("#left").hide();
} else {
$("#left").show();
}
};
Office.context.document.addHandlerAsync(Office.EventType.ActiveViewChanged, _hideArrowInPresentationMode);
是否有 API 方法允许我触发演示模式?
出于某种原因,我在文档中找不到它。
为什么要触发演示模式?当用户按 F5 时,它默认进入演示模式。但是,如果焦点位于加载项中,则会刷新加载项。我正在监听 F5 键并阻止刷新,但我想进入演示模式以确保一致的行为。
PowerPoint 目前没有API进入演示模式。欢迎在 Office Developer Platform's Uservoice!
上申请这个 API
我们有一种方法可以检查 PowerPoint 文档的当前状态:https://msdn.microsoft.com/EN-US/library/office/dn482495.aspx
Document.getActiveViewAsync
我也可以监听状态的变化:https://msdn.microsoft.com/EN-US/library/office/dn482501.aspx
ActiveViewChanged event
我已经在使用如下:
var _hideArrowInPresentationMode = function(e) {
var presentationMode = (e.activeView === "read"); // can inline variable but I find 'presentationMode' more descriptive
if (presentationMode) {
$("#left").hide();
} else {
$("#left").show();
}
};
Office.context.document.addHandlerAsync(Office.EventType.ActiveViewChanged, _hideArrowInPresentationMode);
是否有 API 方法允许我触发演示模式?
出于某种原因,我在文档中找不到它。
为什么要触发演示模式?当用户按 F5 时,它默认进入演示模式。但是,如果焦点位于加载项中,则会刷新加载项。我正在监听 F5 键并阻止刷新,但我想进入演示模式以确保一致的行为。
PowerPoint 目前没有API进入演示模式。欢迎在 Office Developer Platform's Uservoice!
上申请这个 API