office-addins 相关问题

对于Office的新加载项,请同时在您的问题中添加office-js标记。 Microsoft Visual Studio提供了可用于为Microsoft Office 2010和Office 2007创建应用程序级加载项的项目模板。您可以使用加载项自动执行Office,扩展Office功能或自定义Office用户界面。

浏览器Outlook Bot而非本地桌面Outlook中的Web加载项加载

我已经构建了一个Word加载项,该加载项可在本机桌面Word和浏览器Word中使用。我有一个可在浏览器Outlook中使用的Outlook加载项,但是当我将其添加到本机桌面Outlook时,会看到以下信息:...

回答 1 投票 -1

Excel桌面,AzureAD身份验证不起作用

在开发Excel加载项时,我遇到了一个问题。它可以在在线版本中正常工作,但是在桌面版本上运行时,它无法打开任何弹出窗口,以...

回答 1 投票 1

虽然通过VSTO加载项打开现有的MS Word文档时出现异常,但是由于对话框已打开,您无法关闭Microsoft Word

我已经开发了VSTO加载项。我创建了一个功能区,它使搜索按钮出现在MS Word的“加载项”选项卡中。此搜索按钮将打开一个窗口,该窗口允许用户从......>

回答 1 投票 -1

VSTO。如何确定项目的GUID?

我正在尝试创建一个加载项。我得到一个错误。我找到了错误的解决方案-链接。要解决该错误,需要字符串HKEY_CURRENT_USER \ Software \ Microsoft \ VSTA \ Solutions \ {GUID}。 ...

回答 1 投票 0

使用Office JS遍历Word文档

我正在使用Angular制作Word加载项,而我在这里停留在这里。我正在尝试遍历文档以查找单词的出现,但是没有对...

回答 1 投票 1

如何实际减少工作表的使用范围(Excel插件)

我的插件从每张纸上删除了很多行,但是当我按ctrl + end时,光标仍然移到初始范围的最后一个单元格,现在该单元格为空。这是我的简略版本...

回答 1 投票 0

如何在Word中强调文本,而无需像语法一样修改文档

我正在为Word(以及Outlook)编写VSTO加载项。我想强调文本的某些部分(检测到的错误)。据我所知,在Microsoft中没有用于这种强调的API。...

回答 1 投票 0

OpenXML DataBinding不适用于名称空间

我有一个Word文档,其中包含一个内容控件XML。这是来自document.xml的内容控件的代码: [[[[]]]] 下面的单元测试表明,只有在使用命名空间前缀(例如“ ex”)的情况下,您才能将w:sdt元素绑定到具有XML命名空间(例如“ http://example.com”)的自定义XML元素。 )放在w:prefixMappings元素的w:xpath和w:dataBinding属性中。 不过,您的自定义XML元素不需要名称空间前缀。因此,以下两个XML文档都将起作用: <?xml version="1.0" encoding="utf-8"?> <ex:Root xmlns:ex="http://example.com"> <ex:Node>VALUE1</ex:Node> </ex:Root> <?xml version="1.0" encoding="utf-8"?> <Root xmlns="http://example.com"> <Node>VALUE1</Node> </Root> 这里是单元测试: using System; using System.Xml.Linq; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.CustomXmlDataProperties; using DocumentFormat.OpenXml.Packaging; using OpenXmlPowerTools; using Xunit; namespace CodeSnippets.Tests.OpenXml.Wordprocessing { public class DataBoundContentControlTests { private const WordprocessingDocumentType Type = WordprocessingDocumentType.Document; private const string NsPrefix = "ex"; private const string NsName = "http://example.com"; private static readonly XNamespace Ns = NsName; private static string CreateCustomXmlPart(MainDocumentPart mainDocumentPart, XElement rootElement) { CustomXmlPart customXmlPart = mainDocumentPart.AddCustomXmlPart(CustomXmlPartType.CustomXml); customXmlPart.PutXDocument(new XDocument(rootElement)); return CreateCustomXmlPropertiesPart(customXmlPart); } private static string CreateCustomXmlPropertiesPart(CustomXmlPart customXmlPart) { XElement rootElement = customXmlPart.GetXElement(); if (rootElement == null) throw new InvalidOperationException(); string storeItemId = "{" + Guid.NewGuid().ToString().ToUpper() + "}"; // Create a ds:dataStoreItem associated with the custom XML part's root element. var dataStoreItem = new DataStoreItem { ItemId = storeItemId, SchemaReferences = new SchemaReferences() }; if (rootElement.Name.Namespace != XNamespace.None) { dataStoreItem.SchemaReferences.AppendChild(new SchemaReference {Uri = rootElement.Name.NamespaceName}); } // Create the custom XML properties part. var propertiesPart = customXmlPart.AddNewPart<CustomXmlPropertiesPart>(); propertiesPart.DataStoreItem = dataStoreItem; propertiesPart.DataStoreItem.Save(); return storeItemId; } [Fact] public void CanDataBindBlockLevelSdtToCustomXmlWithNsPrefixIfNsPrefixInPrefixMapping() { // The following root element has an explicitly created attribute // xmlns:ex="http://example.com": // // <ex:Root xmlns:ex="http://example.com"> // <ex:Node>VALUE1</ex:Node> // </ex:Root> // var customXmlRootElement = new XElement(Ns + "Root", new XAttribute(XNamespace.Xmlns + NsPrefix, NsName), new XElement(Ns + "Node", "VALUE1")); using WordprocessingDocument wordDocument = WordprocessingDocument.Create("SdtBlock_NsPrefix_WithNsPrefixInMapping.docx", Type); MainDocumentPart mainDocumentPart = wordDocument.AddMainDocumentPart(); string storeItemId = CreateCustomXmlPart(mainDocumentPart, customXmlRootElement); mainDocumentPart.PutXDocument(new XDocument( new XElement(W.document, new XAttribute(XNamespace.Xmlns + "w", W.w.NamespaceName), new XElement(W.body, new XElement(W.sdt, new XElement(W.sdtPr, new XElement(W.dataBinding, // Note the w:prefixMapping attribute WITH a namespace // prefix and the corresponding w:xpath atttibute. new XAttribute(W.prefixMappings, $"xmlns:{NsPrefix}='{NsName}'"), new XAttribute(W.xpath, $"{NsPrefix}:Root[1]/{NsPrefix}:Node[1]"), new XAttribute(W.storeItemID, storeItemId))), new XElement(W.sdtContent, new XElement(W.p))))))); // Note that we just added an empty w:p to the w:sdtContent element. // However, if you open the Word document created by the above code // in Microsoft Word, you should see a single paragraph saying // "VALUE1". } [Fact] public void CanDataBindBlockLevelSdtToCustomXmlWithoutNsPrefixIfNsPrefixInPrefixMapping() { // The following root element has an implicitly created attribute // xmlns='http://example.com': // // <Root xmlns="http://example.com"> // <Node>VALUE1</Node> // </Root> // var customXmlRootElement = new XElement(Ns + "Root", new XElement(Ns + "Node", "VALUE1")); using WordprocessingDocument wordDocument = WordprocessingDocument.Create("SdtBlock_DefaultNs_WithNsPrefixInMapping.docx", Type); MainDocumentPart mainDocumentPart = wordDocument.AddMainDocumentPart(); string storeItemId = CreateCustomXmlPart(mainDocumentPart, customXmlRootElement); mainDocumentPart.PutXDocument(new XDocument( new XElement(W.document, new XAttribute(XNamespace.Xmlns + "w", W.w.NamespaceName), new XElement(W.body, new XElement(W.sdt, new XElement(W.sdtPr, new XElement(W.dataBinding, // Note the w:prefixMapping attribute WITH a namespace // prefix and the corresponding w:xpath atttibute. new XAttribute(W.prefixMappings, $"xmlns:{NsPrefix}='{NsName}'"), new XAttribute(W.xpath, $"{NsPrefix}:Root[1]/{NsPrefix}:Node[1]"), new XAttribute(W.storeItemID, storeItemId))), new XElement(W.sdtContent, new XElement(W.p))))))); // Note that we just added an empty w:p to the w:sdtContent element. // However, if you open the Word document created by the above code // in Microsoft Word, you should see a single paragraph saying // "VALUE1". } [Fact] public void CannotDataBindBlockLevelSdtToCustomXmlWithDefaultNsIfNotNsPrefixInPrefixMapping() { // The following root element has an implicitly created attribute // xmlns='http://example.com': // // <Root xmlns="http://example.com"> // <Node>VALUE1</Node> // </Root> // var customXmlRootElement = new XElement(Ns + "Root", new XElement(Ns + "Node", "VALUE1")); using WordprocessingDocument wordDocument = WordprocessingDocument.Create("SdtBlock_DefaultNs_WithoutNsPrefixInMapping.docx", Type); MainDocumentPart mainDocumentPart = wordDocument.AddMainDocumentPart(); string storeItemId = CreateCustomXmlPart(mainDocumentPart, customXmlRootElement); mainDocumentPart.PutXDocument(new XDocument( new XElement(W.document, new XAttribute(XNamespace.Xmlns + "w", W.w.NamespaceName), new XElement(W.body, new XElement(W.sdt, new XElement(W.sdtPr, new XElement(W.dataBinding, // Note the w:prefixMapping attribute WITHOUT a namespace // prefix and the corresponding w:xpath atttibute. new XAttribute(W.prefixMappings, $"xmlns='{NsName}'"), new XAttribute(W.xpath, "Root[1]/Node[1]"), new XAttribute(W.storeItemID, storeItemId))), new XElement(W.sdtContent, new XElement(W.p))))))); // Note that we just added an empty w:p to the w:sdtContent element. // If you open the Word document created by the above code in Microsoft // Microsoft Word, you will only see an EMPTY paragraph. } } }

回答 1 投票 0

Office Outlook加载项(网络)如何知道是否收到新邮件

我正在尝试在Office Outlook中开发一个外接程序,该外接程序应自动读取传入的电子邮件并对其进行逻辑处理。我必须特别指定...

回答 1 投票 0

Office 365加载项Excel-外部数据

我正在寻找一些有关如何使用基于Javascript API的Office 365 Excel加载项的指南。加载项的目的是允许用户自定义自己的excel文件...

回答 1 投票 0

通过TDMExcelAddIn导入的多个TDM文件在“导入文件”方法中出现错误

因此,我收到了一次修改TDMExcelAddIn提供的正常功能的请求,即一次将一个文件导入到多个文件中。我搜索了一下,发现了这个线程...

回答 1 投票 0

Microsoft AppSource中的清单ID重复的问题

我在卖方仪表板验证测试结果中收到以下验证错误:外接程序清单中使用的外接程序清单ID似乎已经是另一个外接程序的副本...

回答 1 投票 0

如何学习OFFICE 365加载项(Office.js)

[学习如何开发OFFICE 365外接程序的最佳书籍或课程是什么?]

回答 1 投票 0

C#VSTO Outlook加载项:不释放MailItem对象可能有什么影响

与Outlook中的MailItems交互时使用Marshal.ReleaseComObject的重要性是什么?我指的是在https://docs.microsoft.com/zh-cn]上创建C#VSTO Outlook插件的演练。

回答 2 投票 1

Outlook事件函数在共享邮箱上使用时会多次触发-C#

我具有检查每个新来的电子邮件收件箱的功能,如果收到回复,它将移至“回复”文件夹。它在多人计算机的共享邮箱上运行。问题是,它移动了电子邮件...

回答 1 投票 0

寻找Outlook Office Web约会OOTB“删除”按钮事件处理程序

由于我们能够在发送按钮上跟踪OnSend事件。删除事件时是否可以跟踪删除按钮上的删除事件?请参见以下屏幕截图。屏幕截图

回答 1 投票 0

Word加载项(office-js)-createDocument函数无法在Word Online中正常工作

我有一个Word加载项,它正在尝试使用createDocument()函数在运行时创建一个新文档,然后将其打开。这在桌面上的Word上运行良好。但是,在Word中运行时...

回答 1 投票 1

Office加载项发送功能

我目前在某些台式机客户端上的发送功能有问题。我已经实现了插件,但是对于某些桌面客户端,电子邮件被阻止发送。电子邮件挂起并执行...

回答 1 投票 0

MS Office加载项,JavaScript和异步/等待

我目前正在努力加快为Excel编写外接程序的工作,并完成了许多有关该主题的阅读工作,并且正在关注这个出色的教程系列。在示例中,...

回答 1 投票 -2

Office.js:AddImage()在Excel联机版本中不起作用

我正在尝试从使用Office.js添加的Excel添加新图像。那是我的代码:image = activeWorkSheet.shapes.addImage(imageBase64);等待context.sync(); //设置一些图片...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.