DEBUG出错,请大家指点,我刚刚开始学,什么都不懂,请大家帮帮我在WORD里添加插件,
修改Connect.cs的一些函数namespace AK47
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class Connect : Object, Extensibility.IDTExtensibility2
{
LINE28: CommandBarButton InsertPictureButton;
....后面省略
debug结果:
E:\My project\lj\AK47\AK47\Connect.cs(28,9): 错误 CS0246: 找不到类型或命名空间名称“CommandBarButton”(是否缺少 using 指令或程序集引用?)
E:\My project\lj\AK47\AK47\Connect.cs(168,40): 错误 CS0246: 找不到类型或命名空间名称“CommandBarButton”(是否缺少 using 指令或程序集引用?)编译完成 -- 2 个错误,0 个警告
========== 生成: 0 成功或最新,1 失败,0 被跳过 ==========是我的commandBarButton用的有问题么?请大家帮忙看看,感激中~~~~
修改Connect.cs的一些函数namespace AK47
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class Connect : Object, Extensibility.IDTExtensibility2
{
LINE28: CommandBarButton InsertPictureButton;
....后面省略
debug结果:
E:\My project\lj\AK47\AK47\Connect.cs(28,9): 错误 CS0246: 找不到类型或命名空间名称“CommandBarButton”(是否缺少 using 指令或程序集引用?)
E:\My project\lj\AK47\AK47\Connect.cs(168,40): 错误 CS0246: 找不到类型或命名空间名称“CommandBarButton”(是否缺少 using 指令或程序集引用?)编译完成 -- 2 个错误,0 个警告
========== 生成: 0 成功或最新,1 失败,0 被跳过 ==========是我的commandBarButton用的有问题么?请大家帮忙看看,感激中~~~~
解决方案 »
- 如何用C#实现将pdf导出成Excel
- C# 如何给DataGridView中添加一个时间控件
- 数据库连接问题
- this.notifyIcon1.Text长度问题
- 关于单元测试(NUnit.org)
- Winform又有两个有关dataGrid的问题 ,up者有分!!!
- 通过Process.MainWindowTitle获取进程主窗口的标题为空
- 不安装oracle 客户端软件情况下能用Oracle .NET Framework 数据提供程序直接连接远程oracle服务器吗?
- 一天只能添加一条记录(24小时内)
- streamwriter类的方法write为什么不能把汉字写入一个文件,在线等待
- 很菜,关于TREEVIEW
- crm的技术问题!!!
原来就添加了word的dll了,加上using Microsoft.Office.Core;
后,debug,原来的问题解决了,但是有了新问题,麻烦你帮我看看,谢谢:
e:\My project\lj\AK47\AK47\Connect.cs(121,91): 错误 CS0103: 当前上下文中不存在名称“BindingFlags”
e:\My project\lj\AK47\AK47\Connect.cs(126,84): 错误 CS0103: 当前上下文中不存在名称“BindingFlags”
e:\My project\lj\AK47\AK47\Connect.cs(127,99): 错误 CS0103: 当前上下文中不存在名称“BindingFlags”
e:\My project\lj\AK47\AK47\Connect.cs(149,13): 错误 CS0103: 当前上下文中不存在名称“InsertPicutreButton”
e:\My project\lj\AK47\AK47\Connect.cs(151,43): 错误 CS0103: 当前上下文中不存在名称“ture”
e:\My project\lj\AK47\AK47\Connect.cs(152,40): 错误 CS0103: 当前上下文中不存在名称“new_CommandBarButtonEvents_ClickEventHandler”
e:\My project\lj\AK47\AK47\Connect.cs(178,41): 错误 CS1002: 应输入 ;
e:\My project\lj\AK47\AK47\Connect.cs(178,41): 错误 CS1525: 无效的表达式项“.”
e:\My project\lj\AK47\AK47\Connect.cs(178,42): 错误 CS1002: 应输入 ;原程序:
……
CommandBars oCommandBars;
CommandBar oStandardBar; try
{
LINE121 oCommandBars = (CommandBars)wordApp.GetType().InvokeMember("CommandBars", BindingFlags.GetProperty, null, wordApp, null);
}
catch (Exception)
{
object oActiveExplorer;
oActiveExplorer = wordApp.GetType().InvokeMember("ActiveExplorer",
LINE126 BindingFlags.GetProperty, null, wordApp, null);
oCommandBars = (CommandBars)oActiveExplorer.GetType().InvokeMember
LINE 127 ("CommandBars", BindingFlags.GetProperty, null, oActiveExplorer, null);
}……
LINE149 InsertPicutreButton.FaceId = 6578;
InsertPictureButton.Tag = "插入图片";
LINE151 InsertPictureButton.Visible = ture;
LINE152 InsertPictureButton.Click+=new_CommandBarButtonEvents_ClickEventHandler(InsertPictureButton_Click);
}
……
if (ofd.ShowDialog()==DialogResult.OK)
{
object omissing=System.Reflection.Missing.Value;
LINE178 wordApp ActiveWindow.Selection.Inlineshapes.AddPictures(
ofd .FileName,ref omissing ,ref omissing,ref omissing);
}我刚开始学,什么都不懂,麻烦大家了~~~~感激不尽!!!!!
BindingFlags找不到,true写成了ture,还掉了分号
LINE152
InsertPictureButton.Click+=new_CommandBarButtonEvents_ClickEventHandler(InsertPictureButton_Click);
LINE178
object omissing=System.Reflection.Missing.Value;
wordApp ActiveWindow.Selection.Inlineshapes.AddPictures(
ofd .FileName,ref omissing ,ref omissing,ref omissing);e:\My project\lj\AK47\AK47\Connect.cs(149,13): 错误 CS0103: 当前上下文中不存在名称“InsertPicutreButton”
e:\My project\lj\AK47\AK47\Connect.cs(152,40): 错误 CS0103: 当前上下文中不存在名称“new_CommandBarButtonEvents_ClickEventHandler”
e:\My project\lj\AK47\AK47\Connect.cs(178,41): 错误 CS1002: 应输入 ;
e:\My project\lj\AK47\AK47\Connect.cs(178,41): 错误 CS1525: 无效的表达式项“.”
e:\My project\lj\AK47\AK47\Connect.cs(178,42): 错误 CS1002: 应输入 ;