vsto

VSTO AssemblyResolve issue

只愿长相守 提交于 2020-05-31 10:16:10
问题 We develop a VSTO plugin for Word and we have the problem that the earliest entry point of the addin is the AddIn_Startup handler. The issue is that this handler is called too late for the AssemblyResolve handler we implemented to find the needed assemblies. I sovled the problem by assigning the handler to the AppDomain.CurrentDomain.AssemblyResolve event in the Addins.Designer.cs class, but as you all know, this code is autogenerated. Is there a way to assign the AssemblyResolve Handler

VSTO AssemblyResolve issue

喜欢而已 提交于 2020-05-31 10:15:07
问题 We develop a VSTO plugin for Word and we have the problem that the earliest entry point of the addin is the AddIn_Startup handler. The issue is that this handler is called too late for the AssemblyResolve handler we implemented to find the needed assemblies. I sovled the problem by assigning the handler to the AppDomain.CurrentDomain.AssemblyResolve event in the Addins.Designer.cs class, but as you all know, this code is autogenerated. Is there a way to assign the AssemblyResolve Handler

Test certificate not trusted

ぃ、小莉子 提交于 2020-05-28 09:28:26
问题 I develop VSTO solutions for Word and Excel. Since yesterday, for no apparent reason, I am now unable to debug any of my solutions. I face the same symptoms even when I try to debug a new blank VSTO project. When the add-in launches (typically at Excel or Word startup), the following shows up: System.Security.SecurityException: Customized functionality in this application will not work because the certificate used to sign the deployment manifest for ExcelAddIn1 or its location is not trusted.

VSTO Outlook Plugin: Cannot get AppointmentItem in Item_Change event when recurring appointment is dragged and dropped by user

こ雲淡風輕ζ 提交于 2020-05-24 07:28:46
问题 I want to catch the change event on an AppointmentItem. I use Outlook 2017 for tests. To achieve I use: I attached the events like this: public void AttachEvents() { _CalendarItems.ItemAdd += Item_Add; _CalendarItems.ItemChange += Item_Change; _DeletedItems.ItemAdd += Item_Delete_Add; The Item_Change method looks like this: public void Item_Change(Object item) { if (item != null && item is Outlook.AppointmentItem) { Outlook.AppointmentItem myAppointment = item as Outlook.AppointmentItem; To

Adding Power Queries to Excel using c#

…衆ロ難τιáo~ 提交于 2020-05-17 07:02:48
问题 I want to replicate the following code from VBA into c# VSTO: M_Script = LoadTextFile(qname, wk) qSource = workbook_path & "\" & qname & ".csv" Dim qry As WorkbookQuery Set qry = wk.Queries.Item(qname) qry.Formula = M_Script Set qry = wk.Queries.Add(qname, M_Script, qSource) wk.Connections.Add2 "Query - " & query.Name, _ "Connection to the '" & query.Name & "' query in the workbook.", _ "OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=" & query.Name _ , """" & query

Outlook VSTO Handling SelectionChange correctly (currently doubleclick crashes Addin)

好久不见. 提交于 2020-05-17 05:56:08
问题 From what I understand you need to track Activation and Deactivation of the Explorers. During activation, you need to add SelectionChange event handlers for the current explorer. This seems to work perfectly for single clicks on AppointmentItems. But it crashes the Addin when double-clicking on an appointment series and selecting a single Appointment. Here is the source: On class level private Outlook.Explorer currentExplorer = null; private Outlook.AppointmentItem currentAppointmentItem =

MailItem.HtmlBody throws a Not Implemented exception

只谈情不闲聊 提交于 2020-05-15 08:03:09
问题 I have a ribbon button that inserts text into an outlook Inspector by modifying the MailItem object based on the recipients in it. The method that gets called on click looks like this: public async void OnTemplateClick(Office.IRibbonControl control) { var templateId = control.Tag; var template = templates.GetTemplateById(templateId); await templateUi.SetTemplate(control.Context, template); } the SetTemplate method looks like this: public async Task SetTemplate(object window, Template template

Outlook VSTO add context menu item

拥有回忆 提交于 2020-05-13 20:54:19
问题 I am trying to add a menu item to the attachment context menu. The problem is that the item does not show up. I've seen some examples where they say that this code should work: this.Application.AttachmentContextMenuDisplay += new ApplicationEvents_11_AttachmentContextMenuDisplayEventHandler(ThisAddIn_AttachmentContextMenuDisplay); private void ThisAddIn_AttachmentContextMenuDisplay(CommandBar commandBar, AttachmentSelection attachments) { if (attachments.Count > 0) { var cbc = commandBar

Outlook VSTO add context menu item

≡放荡痞女 提交于 2020-05-13 20:51:46
问题 I am trying to add a menu item to the attachment context menu. The problem is that the item does not show up. I've seen some examples where they say that this code should work: this.Application.AttachmentContextMenuDisplay += new ApplicationEvents_11_AttachmentContextMenuDisplayEventHandler(ThisAddIn_AttachmentContextMenuDisplay); private void ThisAddIn_AttachmentContextMenuDisplay(CommandBar commandBar, AttachmentSelection attachments) { if (attachments.Count > 0) { var cbc = commandBar

Is it possible to have more than one custom tab for the office ribbon?

雨燕双飞 提交于 2020-05-11 06:30:47
问题 I can not find any documentation to verify this or any working examples I want to achieve something like this xml below, but I think this really is not possible. <customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2010/01/customui"> <ribbon> <tabs> <tab idMso="TabAddIns" label="Ribbon1"> </tab> <tab idMso="TabAddIns" label="Ribbon2"> </tab> </tabs> </ribbon> </customUI> 回答1: You can have multiple tabs, if you are using exiting tabs then set idMso="exiting tabids"