MS WORD VSTO - 如何显示消息
MS WORD VSTO - How to display a message
在 WORD VSTO AddIn
中做一些 data binding operations 时,如果您想向用户显示成功或失败消息,您会怎么做?例如,在 Winform 应用程序中,我们有 MessageBox 等
您使用 System.Windows.Forms 命名空间(您可能需要添加对 System.Windows.Forms.dll 的引用)并像 Winform 应用程序一样执行此操作:
using System.Windows.Forms;
private void MsgBox()
{
MessageBox.Show("message in vsto");
}
如果这停止工作检查:
officeApp.DisplayAlerts = true;
在 WORD VSTO AddIn
中做一些 data binding operations 时,如果您想向用户显示成功或失败消息,您会怎么做?例如,在 Winform 应用程序中,我们有 MessageBox 等
您使用 System.Windows.Forms 命名空间(您可能需要添加对 System.Windows.Forms.dll 的引用)并像 Winform 应用程序一样执行此操作:
using System.Windows.Forms;
private void MsgBox()
{
MessageBox.Show("message in vsto");
}
如果这停止工作检查:
officeApp.DisplayAlerts = true;