vsto

Change Ribbon-menu properties after ribbon-load

扶醉桌前 提交于 2019-12-25 19:47:51
问题 I build a VSTO (made with the Ribbon Designer, not using Ribbon XML). Is it possible to change the properties (like label) of the Tab from Ribbon1.cs ? I even can't change the ribbon title with : private void Ribbon1_Load(object sender, RibbonUIEventArgs e) { myRibbon.Label = "something"; } 回答1: The way to do this dynamically is using a callback. In your ribbon XML: <tab id="myTabID" getLabel="myCallback"> .... </tab> In your ribbon code: public string myCallback(IRibbonControl control) {

How can I paste special unformatted plain text into Excel using C# and VSTO?

牧云@^-^@ 提交于 2019-12-25 18:25:31
问题 It's hard to believe this question hasn't been asked or is not possible, but that's what I'm seeing from web searches. All I would like to do is use VSTO to paste only the unformatted plain text into the active cell range. Using Range.PasteSpecial only gives the option to paste values (among others), but these include formatting. Is there really no option to paste unformatted text using PasteSpecial? Is there some other way that anyone has found to do this? Using macros are not an option in

VSTO Outlook add-in, does UI manipulation need to be done from main thread?

本小妞迷上赌 提交于 2019-12-25 14:04:27
问题 I'm maintaining a VSTO add-in for Outlook, and it has a BackgroundWorker that handles syncing with a server. I want the worker to trigger user errors in the UI (changing the picture on a button, enabling a message in a settings window). Does UI manipulation need to be done from the initial thread? This StackOverflow answer says not, but a comment on it says so. It's for Excel, but still for a VSTO add-in. I tried and it seems to work from either thread, but there could be a race condition I

How to execute VSTO post-install by WiX

别来无恙 提交于 2019-12-25 13:14:12
问题 I need to run some VSTOs after they been installed. Everything I tried came out negative. One example: <Property Id="runcmd">start</Property> <CustomAction Id="RunOutlookVSTO" Property="runcmd" Execute="deferred" Return="asyncNoWait" ExeCommand="[SourceDir]Outlook2010AddIn.vsto"> </CustomAction> <InstallExecuteSequence> <Custom Action="RunOutlookVSTO" After="PublishProduct">NOT INSTALLED</Custom> </InstallExecuteSequence> Error: No reaction. Second example: replace start with cmd Error: No

Programmaticaly disable existing button in outlook compose window ribbon

ぐ巨炮叔叔 提交于 2019-12-25 09:05:31
问题 Am writing an outlook add-in in c#. I would like to disable the "Permissions" button in the "Options" tab while composing a new email. Am currently using Addin express for creating the outlook add-in 回答1: You need to use command tag with the getEnabled attribute defined. For example: <?xml version="1.0" encoding="UTF-8"?> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load"> <commands> <command idMso="Permissions" getEnabled="OnGetEnabled" /> </commands>

Outlook VSTO - Calling TypeText on Selection throws “This command is not available” Exception

淺唱寂寞╮ 提交于 2019-12-25 08:09:09
问题 Calling TypeText on Selection throws "This command is not available." exception Below is my code public void AddFilePaths(List<string> urls) { if (urls.Count > 0) { MailItem mi = null; bool newMailItem = false; mi = MyAddIn.Application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); mi.Body = "New email body"; newMailItem = true; mi.Display(); inspector = MyAddIn.Application.ActiveInspector(); if (mi != null) { foreach (var url in urls) { AddPathToActiveInspector(urls); }

How to refresh outlook profile signature settings in registry

ε祈祈猫儿з 提交于 2019-12-25 07:30:12
问题 I have made an outlook plug in that downloads a new signature and creates the registry keys for the profile to set the new and reply signature. Is it possible to get outlook to pick up these new registry settings without restarting? Edit: Just to clarify the settings I am applying in the registry are in the sub keys of "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office[OFFICE VERSION]\Outlook\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676" which hold the profile settings. 回答1: No - any changes

Trying to connect a comboBox in word to a database in Access using Visual Basic

三世轮回 提交于 2019-12-25 07:28:48
问题 I've been working on this for the past 6 hours and I'm getting a frustrating error. For now, I want to add a combo box into my blank word document and populate it with a data from a field in a table I created in Access. I'm using Visual Studio 2015 as my IDE and the Word 2013 Document Template. ERROR An exception of type 'System.Runtime.InteropServices.COMException' occurred in WordInvoice.dll but was not handled in user code Additional information: Provider cannot be found. It may not be

Outlook Add In - Selecting the Active Inspector on Item Send

依然范特西╮ 提交于 2019-12-25 06:24:07
问题 I am trying to identify the item type on the item send event. I am very close to getting there but the program is not recognising the current item type if a different window has been opened previously. Here is the code used: void Application_ItemSend(object Item, ref bool Cancel) { inspectors = this.Application.Inspectors; currentExplorer = this.Application.ActiveExplorer(); currentExplorer.InlineResponse += ThisAddIn_InlineResponse; Outlook.Inspector inspector = Application.ActiveInspector()

ClickOnce Automatic Update error for VSTO- add-in for Excel

北战南征 提交于 2019-12-25 04:57:28
问题 I created a simple test program to try and understand how Click-Once deployment works and whether or not I can have the program automatically updated. It is an excel add-in with a button in the ribbon that outputs some message box. I have the deployment location set to a public location on the network and updates set to check every time the customization runs. Great - I install the add-in, open Excel, it works fine. Now I go into visual studio and update and re-publish the add-in. Now when I