C# MS WORD VSTO-如何显示消息
在C# MS WORD VSTO-如何显示消息,c#,visual-studio-2015,vsto,C#,Visual Studio 2015,Vsto,在WORD VSTO AddIn中执行某些操作时,如果要向用户显示成功或失败消息,将如何执行?例如,在Winform应用程序中,我们有MessageBox等。您使用System.Windows.Forms命名空间(您可能需要添加对System.Windows.Forms.dll的引用),并与Winform应用程序相同: 使用System.Windows.Forms private void MsgBox() { MessageBox.Show("message in vsto"); } 如
WORD VSTO AddIn中执行某些操作时,如果要向用户显示成功或失败消息,将如何执行?例如,在Winform应用程序中,我们有MessageBox等。您使用System.Windows.Forms命名空间(您可能需要添加对System.Windows.Forms.dll的引用),并与Winform应用程序相同:
使用System.Windows.Forms代码>
private void MsgBox()
{
MessageBox.Show("message in vsto");
}
如果停止工作,请检查:
officeApp.DisplayAlerts=true代码>您使用System.Windows.Forms命名空间(可能需要添加对System.Windows.Forms.dll的引用),并与Winform应用程序相同:
使用System.Windows.Forms代码>
private void MsgBox()
{
MessageBox.Show("message in vsto");
}
如果停止工作,请检查:
officeApp.DisplayAlerts=true
您使用Winform名称空间,并与Winform应用程序MessageBox.Show()相同。“你没试过这个吗?”杰里米·汤普森说,它奏效了(谢谢)。为了方便其他用户,您可能希望将您的注释转换为答案
——确切解释需要添加的名称空间——我将其标记为答案。好的,为此干杯:)您使用Winform名称空间,并与Winform应用程序MessageBox.Show()相同。“你没试过这个吗?”杰里米·汤普森说,它奏效了(谢谢)。为了方便其他用户,您可能希望将您的注释转换为答案
——确切说明需要添加哪个名称空间——我将其标记为答案。好的,为此干杯:)