簡體   English   中英

Powerpoint 中的 VSTO C#:WindowSelectionChange 事件

[英]VSTO C# in Powerpoint: WindowSelectionChange Event

我是 VSTO 和 C# 的新手,並且對事件有疑問。 當用戶在 PowerPoint 中選擇某些內容(例如形狀、幻燈片等)時,我試圖觸發一個事件。

我在此處的 Office 文檔中找到了 VBA 的有效解決方案,並在此處找到了有關 Word 選擇處理程序更多信息,但是我不知道如何以及在何處將其添加到我的ThisAddIn.cs上下文中。

我目前正在使用新的 C# PowerPoint VSTO Addin 空白 C# PowerPoint VSTO 插件

任何指向正確方向的指針都非常受歡迎。 謝謝!

找到這個並且它有效:

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        this.Application.WindowSelectionChange += Application_WindowSelectionChange;

    }

    private void Application_WindowSelectionChange(PowerPoint.Selection Sel)
    {
        //throw new NotImplementedException();
        MessageBox.Show("Hello");
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM