Tag: office 2010

替换Outlook 2010发送按钮?

我正在寻找以下问题的解决方案。 有人可以帮帮我吗? 我需要使用下拉按钮替换Outlooks Send-button,例如我的屏幕截图中的“Von”(From)按钮。 仅供参考:新的Send-DropDown按钮将具有三个function:1。Outlooks默认发送function(普通发送按钮)2。发送和存档邮件3.发送和存档邮件+附件 谁能帮我吗? 是否有可能像我想要的那样进行替换? 如果没有 – 有没有人有我的问题的其他解决方案? 非常感谢!

Microsoft Word Interop自动化FilePrintSetup错误

我收到“有打印机错误。” 当在Windows 7上使用Word 2010使用自动化时,使用自动化将打印作业发送到打印机时。相同的代码在使用Word 2007的Windows XP盒上工作正常。我不确定Windows 7或Word 2010是否导致错误。 任何帮助赞赏 using Microsoft.Office.Interop.Word; ….. object oWordbasic = wordDoc.Application.WordBasic; object[] argValues = new object[] { value, 1 }; //first arg is a printer name String[] argNames = new String[] { “Printer”, “DoNotSetAsSysDefault”, }; //Error Here oWordbasic.GetType().InvokeMember(“FilePrintSetup”, System.Reflection.BindingFlags.InvokeMethod, null, oWordbasic, argValues, null, null, argNames); 我得到下面的错误 System.Reflection.TargetInvocationException was caught Message=Exception […]

事件处理程序未添加到新邮件项目

我正在尝试创建一个简单的Outlook 2010加载项,以响应新的附件事件。 下面的代码仅在我取消注释MessageBox.Show行时才有效。 但删除它似乎不添加事件处理程序。 我对程序流的缺失是什么意味着模态消息框会影响事件处理程序的位置? public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.Inspectors.NewInspector += Inspectors_NewInspector; } void Inspectors_NewInspector(Outlook.Inspector Inspector) { Outlook.MailItem mailItem = Inspector.CurrentItem as Outlook.MailItem; if (mailItem != null) { if (mailItem.EntryID == null) { mailItem.BeforeAttachmentAdd += mailItem_BeforeAttachmentAdd; //System.Windows.Forms.MessageBox.Show(“Twice”); } } } void mailItem_BeforeAttachmentAdd(Outlook.Attachment Attachment, ref bool Cancel) { […]

适用于Excel 2007和2010的Excel Addin

我正在编写一个应该在2007年和2010年都可以工作的Excel Addin。当我使用Visual Studio创建一个新项目时,我需要决定我想要的版本。 我之前选择过2007,但自从我安装了2010以后,我无法调试它。 我收到一个错误: 您无法调试或运行此项目,因为未安装所需的Microsft Office应用程序版本。 我的理解是,如果我以2007年为目标,我应该能够在2007年和2010年都运行它。这是正确的吗? 如果是这样,我可以使用2010进行调试吗?

如果我为Office 2007编写一个加载项,它是否适用于2010年,2013年?

我目前正在重写为Office 2003编写的一些VBA宏。我想知道我是否为2007年编写了一个C#插件,如果它可以在2010年或甚至2013年工作。或者如果我写它们2010年,如果他们也将在2007年和2013年工作。 我目前可以访问2007年,但如果需要,我可以访问2010年,还有2013年。 那么,基本上,办公室的版本对插件有多大影响?

使用OpenXML在Word中获取CheckBox

如何使用OpenXML获取嵌入在Word文档中的CheckBox控件的句柄? 您会认为Paragraph.ControlPropertiesPart或Paragraph.Descendents()会实现某些function,但在每种情况下我都会返回null类型。 我可以使用实际的XML结构遍历文档树,但这看起来很麻烦。 建议欢迎。

c#word interop查找并替换所有内容

我有一些代码来替换单词2010 docx中的文本。 object fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, “document.docx”); Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true }; Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true); aDoc.Activate(); Microsoft.Office.Interop.Word.Find fnd = wordApp.ActiveWindow.Selection.Find; fnd.ClearFormatting(); fnd.Replacement.ClearFormatting(); fnd.Forward = true; fnd.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue; fnd.Text = “{id}”; fnd.Replacement.Text = “123456”; fnd.Execute(Replace: WdReplace.wdReplaceAll); 这没有格式化。 但是当{id}被格式化时,它不会替换文本。 如何使此代码忽略格式化?

通过C#通过Outlook 2010发送电子邮件

我正在尝试从我的C#控制台应用程序内部发送电子邮件。 我添加了引用和使用语句,但似乎我没有添加我需要的一切。 这是我第一次尝试这样做,所以我觉得有些东西我已经忘记了。 我从MSDN网站获得了这段代码片段http://msdn.microsoft.com/en-us/library/vstudio/ms269113(v=vs.100).aspx 这是我在VS 2010中遇到问题的代码 using System; using System.Configuration; using System.IO; using System.Net; using System.Net.Mail; using System.Runtime.InteropServices; using Outlook = Microsoft.Office.Interop.Outlook; using Office = Microsoft.Office.Core; namespace FileOrganizer { class Program { private void CreateMailItem() { //Outlook.MailItem mailItem = (Outlook.MailItem) // this.Application.CreateItem(Outlook.OlItemType.olMailItem); Outlook.Application app = new Outlook.Application(); Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem); mailItem.Subject = “This is […]