使用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 :-/
有任何线索吗?
答案 0 :(得分:0)
请尝试以下方法之一解决您的问题,并让我知道结果。
Cursor.Current = Cursors.WaitCursor;
或
this.UseWaitCursor = true;
或
this.Cursor = Cursors.WaitCursor;
或
Application.UseWaitCursor = true;
或
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
答案 1 :(得分:0)
您需要导入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;