主题:MessageBox的问题
DEBUG出错,请大家指点,我刚刚开始学,什么都不懂,请大家帮帮我
在WORD里添加插件,reference里加了
System.Windows.Forms,
System.Drawing,
System.XML,
Microsoft Word 11.0 Object Library
然后修改Connect.cs的一些函数
namespace AK47
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
中间省略
public void OnStartupComplete(ref System.Array custom)
{
MessageBox.Show(wordApp.ActiveDocument.Name);
}
省略
}
debug的结果是------ 已启动生成: 项目: AK47, 配置: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Extensibility.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll /reference:obj\Debug\Interop.Microsoft.Office.Core.dll /reference:obj\Debug\Interop.VBIDE.dll /reference:obj\Debug\Interop.Word.dll /debug+ /optimize- /out:obj\Debug\AK47.dll /target:library AssemblyInfo.cs Connect.cs
e:\My project\lj\AK47\AK47\Connect.cs(106,13): 错误 CS0103: 当前上下文中不存在名称“MessageBox”
编译完成 -- 1 个错误,0 个警告
========== 生成: 0 成功或最新,1 失败,0 被跳过 ==========
在WORD里添加插件,reference里加了
System.Windows.Forms,
System.Drawing,
System.XML,
Microsoft Word 11.0 Object Library
然后修改Connect.cs的一些函数
namespace AK47
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
中间省略
public void OnStartupComplete(ref System.Array custom)
{
MessageBox.Show(wordApp.ActiveDocument.Name);
}
省略
}
debug的结果是------ 已启动生成: 项目: AK47, 配置: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Extensibility.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll /reference:obj\Debug\Interop.Microsoft.Office.Core.dll /reference:obj\Debug\Interop.VBIDE.dll /reference:obj\Debug\Interop.Word.dll /debug+ /optimize- /out:obj\Debug\AK47.dll /target:library AssemblyInfo.cs Connect.cs
e:\My project\lj\AK47\AK47\Connect.cs(106,13): 错误 CS0103: 当前上下文中不存在名称“MessageBox”
编译完成 -- 1 个错误,0 个警告
========== 生成: 0 成功或最新,1 失败,0 被跳过 ==========