2015-09-28 48 views
2

我們有一個方法來檢查PowerPoint文檔的當前狀態:https://msdn.microsoft.com/EN-US/library/office/dn482495.aspx如何以編程方式在PowerPoint加載項中觸發演示模式?

Document.getActiveViewAsync

enter image description here

我還可以聽狀態的變化:https://msdn.microsoft.com/EN-US/library/office/dn482501.aspx

ActiveViewChanged事件

而且我已經使用如下:

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鍵並阻止刷新,但我想進入演示模式以確保一致的行爲。

回答

1

目前PowerPoint中沒有進入演示模式的API。請隨時在Office Developer Platform's Uservoice上申請此API!

+0

看着@Gab Royer的生物 - 他在微軟工作 - 這對我來說已經足夠了。接受答案。 –

+0

你好,Gab!可以看看這個問題嗎? http://stackoverflow.com/questions/36063158/overlay-item-for-all-slides-in-powerpoint –

相關問題