vsto

localize VSTO addin according to the language of the office product

安稳与你 提交于 2019-12-29 07:48:08
问题 I'm developing a VSTO addin and want it to be localized according to the language version of the office product. In theory, that's how to do it: int lcid = Application.LanguageSettings.get_LanguageID(Office.MsoAppLanguageID.msoLanguageIDUI); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lcid); For this to work I need Application to be initialized, of course. So the earliest point where I can execute this code is in the Startup event handler. At

How to raise an event on MS word Keypress

纵饮孤独 提交于 2019-12-29 07:47:28
问题 I am developing a MS-Word addon in which my code has to get access to the letters the user is entering through the keyboard. private void ThisDocument_Startup(object sender, System.EventArgs e) { this.SelectionChange += new SelectionEventHandler(ThisDocument_SelectionChange); } void ThisDocument_SelectionChange(object sender, SelectionEventArgs e) { MessageBox.Show(e.Selection.Text); } I think the SelectionChange event can give me the text but the event is not raised at keypress, Is there any

In VSTO Excel, how to detect data in cells?

删除回忆录丶 提交于 2019-12-29 07:40:14
问题 I was wondering if anyone knew how to quickly detect whether there is data in a given worksheet or not, without actually looping through all of the rows/columns of the worksheet to figure this out. I am writing an importer that will import data right into the active worksheet (if it has not been modified), or create a new worksheet and import into it instead. I am currently looping through the entire sheet, and there is some noticeable lag-time in my import. I would appreciate any help in the

VSTO - Is it possible to have both designer and XML ribbons?

萝らか妹 提交于 2019-12-29 06:19:08
问题 I'm working on an Outlook 2010 add-in that has multiple ribbons created with the Visual Studio 2010 ribbon designer. I've made an additional XML ribbon (I needed to override the default behavior of some built in ribbon buttons, which can't be done with the designer). Enabling the XML ribbon disables all the designer ribbons because I have to override CreateRibbonExtensibilityObject (ContactButtonOverrides is my XML ribbon): protected override Microsoft.Office.Core.IRibbonExtensibility

Word VSTO swallows exceptions at runtime without debugging?

一个人想着一个人 提交于 2019-12-29 05:45:15
问题 Place this code somewhere in a Word document level VSTO solution outside of ThisDocument_Startup (create a ribbon button, with a click event): int zero = 0; int divideByZero = 10 / zero; Start without debugging (Ctrl + F5), Result: Exception is swallowed, the rest of the code fails silently. The exception will be visible if placed in ThisDocument_Startup, but it appears nowhere else. Microsoft's VSTO forums and the MSDN documentation seem to feel Try...Catch should be used - which is not a

Serialize current ActiveDocument from office 2007 add-in

女生的网名这么多〃 提交于 2019-12-29 01:17:33
问题 Im creating a VSTO Office 2007 add-in. I need to be enable or find a solution where I can save to a webservice with a byte[] instead of hard drive. So, I open the document by going to a website and clicking on a url, that click send me a Word Document, and I select Open using MS Word 2007. The document open, and if I check the data I have: ActiveDocument.Fullname = http://[servername or ip]/[some iis folder]/file.asp?id=353&type=doc` so I think this is all in memory since I dont have the

Set custom document properties with Word interop

我只是一个虾纸丫 提交于 2019-12-28 18:05:25
问题 I want to set some custom document properties of a word document I'm creating in my C# code. To do this, I followed this MSDN article and came up with this code: using Word = Microsoft.Office.Interop.Word; // Version 12.0.0.0 word = new Word.Application(); word.Visible = false; Word._Document doc = word.Documents.Add(ref missing, ref missing, ref missing, ref missing); logger.Info("Setting document properties"); Core.DocumentProperties properties = (Core.DocumentProperties)doc

What storage should I use for a outlook plugin?

◇◆丶佛笑我妖孽 提交于 2019-12-28 06:57:20
问题 What storage system should I use , If i'm going to deploy a outlook plugin with VSTO ? Is it possible to use outlook's , which is for email ? UPDATE I thought about SQL Express , but I think I should use the same thing with what outlook uses , that would save troubles 回答1: There are numerous options for you to consider, below I've listed all the ones I've seen used in the past. For Outlook-managed storage you could look into using StorageItem which is a hidden item inside a given folder (

I have a VSTO application as an add-in to MS Word and I want to set keyboard shortcuts to the ribbon buttons

血红的双手。 提交于 2019-12-28 06:34:13
问题 When I developed this app (in C# Visual Studio 2008) I asked the same question (actually managed to find an answer on the MS forum, for which I deserve a prize of some sort). The answer from MS was that the only way to set keyboard shortcuts to your own methods is to write a macro which invokes the method (via COM. obviously) and set the shortcut to invoke that macro. This is really not the answer I want to hear. VSTO makes it possible to build a really nice application with very good use of

Block email sender

旧城冷巷雨未停 提交于 2019-12-27 03:56:06
问题 Is there anyway you can create a code, when you click a button (I've already created this) it will take the selected email and block the sender which will delete the email? 回答1: Outlook Object Model does not expose blocked/safe senders at all. If using Redemption is an option, it exposes RDOJunkEmailOptions object (returned from RDOSession. JunkEmailOptions , RDOAccount. JunkEmailOptions , RDOExchangeMailboxStore. JunkEmailOptions ), which allows to add blocked senders using