【问题标题】:VSTO Outlook Mouse pointer changeVSTO Outlook 鼠标指针变化
【发布时间】:2020-11-13 17:25:56
【问题描述】:

使用 Outlook VSTO 加载项。我正在尝试更改鼠标指针以反映在后台执行的操作。我测试了以下代码:

Cursor.Current = Cursors.WaitCursor

Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

Wait Cursor in VSTO word add-in application

Microsoft.Office.Interop.Outlook.Application app = Globals.ThisAddIn.Application;
app.System.Cursor = wdCursorWait; // --> app.System does not exist + No OutlookCursor :-/

有什么线索吗?

【问题讨论】:

  • 我对@9​​87654325@ 没有任何重大问题,只是它有时会被 Word(而不是 Outlook)设置为未设置。您遇到了什么问题?

标签: c# outlook vsto outlook-addin


【解决方案1】:

请尝试以下方法之一来解决您的问题并告诉我结果。

Cursor.Current = Cursors.WaitCursor;

或者

 this.UseWaitCursor = true;

或者

this.Cursor = Cursors.WaitCursor;

或者

Application.UseWaitCursor = true;

或者

Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

【讨论】:

  • 我在 Outlook 2016 中测试的功能区中单击按钮时,它们都不起作用
【解决方案2】:

需要导入Word.DLL,然后使用如下代码

            Outlook.Inspector currentInspector = Globals.ThisAddIn.Application.ActiveInspector();
            Word.Document document = currentInspector.WordEditor;
            Word.Application wordApp = document.Application;
            wordApp.System.Cursor = Word.WdCursorType.wdCursorWait;
            //perform your task
           //Switch to default Cursor 
           wordApp.System.Cursor = Word.WdCursorType.wdCursorNormal; 

【讨论】:

  • Globals.ThisAddIn.Application.ActiveInspector() 返回 null
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-24
  • 2013-09-09
  • 2010-09-19
  • 1970-01-01
  • 2023-03-27
  • 2012-06-05
相关资源
最近更新 更多