摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using log4net;using System.Windows.Forms;using DocumentFormat.OpenXm... 阅读全文
摘要:
这是一个根据用户需求给出的例子,用来改写“插入表格(I) ...”按钮的动作。我们可以以此引申为在Office中所有Button或CommandButton都可以用这样的方法改变动作。Ribbon Xml 内容如下: Ribbon Class 如下:using System;using... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Forms;using log4net;using Microsoft.Office.Core... 阅读全文
摘要:
环境:Windows 7 旗舰版 Visual Studio 2010、Office 2010重现步骤:在Visual Studio 2010中用C# 建立一个Outlook Add-in 项目(framework 3.5 或framework 4.0)在项目中添加一个Ribbon(Ribbon V... 阅读全文
摘要:
在某些特殊场合我们可能要判断Access DataBase Engine是否安装(例如要建ODBC连接的时候)。我们可以通过检查注册表中是否有[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.ACE.ACERCLRC.14.0]来判断Access Data... 阅读全文
摘要:
在OOM(Outlook Object Module)中UserDefinedProperties看起来非常奇怪,你可以定义它,却不能给它赋值。其实UserDefinedProperties是用来建立一个用户自定义项来显示其文件夹下Item中相应的自定义值的。下面是个用来说明的小例子。using S... 阅读全文
摘要:
这是一个计算Word中文档行数的例程(表格中的行数不算)。Sub test() Dim i As Integer Dim t As Table i = ActiveDocument.range.ComputeStatistics(wdStatisticLines) ... 阅读全文
摘要:
在使用反射的过程中如果发生“exception has been thrown to the target of an invocation”异常,那很有可能是被反射的Assembly中引用了其他Assembly而这些被引用的Assembly在主程序中没有被引用。欢迎访问我的主博客《许阳的红泥屋》 阅读全文
摘要:
Office解决方案分应用级解决方案(application-level solution 也就是Add-in)和文档级解决方案(document-level solution包括Excel template application,Excel workbook application,Word t... 阅读全文
摘要:
在Word中用户可以通过UndoRecord来记录一组动作,并显示在撤销菜单内。这样可以让用户一次性删除大量的操作。下面的代码是在Visual Studio 2010, Word 2010 下建立的一个示例:using System;using System.Collections.Generic;... 阅读全文