vsto

How can I persist data for an Excel Ribbon Addin in Excel

泄露秘密 提交于 2019-12-04 20:04:54
I have created an Excel ribbon addin which needs to persist user selections between Excel sessions. Using custom XML Parts seems to be the best option for this. However I can't get this to work without getting COMExceptions. The MSDN docs are just not very useful (http://msdn.microsoft.com/en-us/library/bb608612.aspx). Can someone give me an example of making this work in an Excel Ribbon addin? There are three different methods I know of: Custom XML parts For an application-level add in, this is my preferred method of storing any application data that needs to be persisted in a saved xls file

Highlight all occurrences of a string in Word using VSTO

老子叫甜甜 提交于 2019-12-04 19:40:09
I would like to highlight all occurrences of a given string in Microsoft Word 2010 using VSTO. So far, I've managed to set the foreground color for the matches using the Find facility: Word.Find find = Application.ActiveDocument.Content.Find; find.Replacement.Font.ColorIndexBi = Word.WdColorIndex.wdYellow; find.Execute(FindText: "dog", MatchCase: false, Replace: Word.WdReplace.wdReplaceAll); However, I would like to set the highlight for the matches, such as in the screenshot below: Set the highlight colour by setting using Application.Options.DefaultHighlightColorIndex to one of the

Registering to the Outlook appointment item 'closed' event using VSTO

淺唱寂寞╮ 提交于 2019-12-04 19:27:11
I am writing an Outlook add-in using VSTO 2010 for Office 2007. How can I register to the Outlook appointment item 'closed' event? Cheers, Doron You can access it via the inspector. In Outlook each item has an associated window, that window is known as the inspector. So you can go: var inspector = appointmentItem.GetInspector(); inspector.Close += Closed; UPDATE: This is one of the crappy things about the office api, there is actually a close event AND a close method. Cast to InspectorEvents_10_Event interface first. ((InspectorEvents_10_Event)inspector).Close += Closed; 来源: https:/

Save and Open Remote Documents

a 夏天 提交于 2019-12-04 19:17:11
I know nothing about microsoft office development, but I would like to build a prototype of a plugin will allow a user to Save and Open documents from a remote repository. Perhaps later build in a version control system on the server - but the server side piece is about the easiest portion of it (in my case). Perhaps I should focus on getting this to work for one office application at a time - say MS WOrd (unless folks think excel is easier to work with). And lets target Office 2007 (as that is what I have installed). Saving The repository will store the document Tagged (by many tags, of many

How to add options hyperlink into Excel Function Arguments Window just like bloomberg's BDH function?

痴心易碎 提交于 2019-12-04 16:15:21
I have developed a excel UDF. One of the UDF parameters has known possible values (A, B, C). So instead of asking all my users to find out what the possible values are I want to provide a option1 (hyperlink) in excel function wizard just like the Bloomberg's BDH function as shown in the screenshot. I know I have to somehow hook upto win32 api and override the call/window when the function wizard is invoked. When I look into SPY++ I see that there is a insert function window and function arguments window . I have broken down the task at hand into 4 sub tasks: Subclass the window “Function

Set Publisher in Word Options Add-Ins Dialog

自作多情 提交于 2019-12-04 10:40:22
I have made an addin for Microsoft Word 2010 Beta using Visual Studio 2010 RTM. When I look at "View and manage Microsoft Office Add-ins" the publisher shows up as None. Would code signing with a Software Publisher Certificate fill in the Publisher field? The ClickOnce manifest is signed with a Code Signing certificate. Would signing the assembly with a strong name key file fill in the Publisher field? Is there a method using codesign.exe that would fill in the Publisher field? Note: Using signtool.exe to sign the addin dll with the certificate results in the publisher showing as None in Word.

How do you package a VSTO Word addin for deployment (to Office 32 bit) using WIX?

回眸只為那壹抹淺笑 提交于 2019-12-04 09:48:13
问题 I developed a VSTO Word add in in VS 2017 Pro. Works fine, ready to deploy. However, I cannot find a working procedure for packaging my VSTO Word add in for use on machines other than my development machine. For any particular machine , I need to deploy it once and have it available for any user who may login using their account. First came across this, but it involves using InstallShield Limited Edition which, apparently is no longer available for VS 2017. Tried this but it a few of its

How to index Word 2003, 2007 and 2010 documents using Lucene.NET

旧城冷巷雨未停 提交于 2019-12-04 09:40:01
问题 I am writing a custom Lucene.NET indexer to enable indexing of MS Word documents. The indexer must be capable of handling last three releases of MS Word: 2010, 2007 and 2003. The plan is to use VSTO interop assemblies that are installed as part of VS2010 to extract text content from the documents. Is there a better way to implement Word document indexing? Does this mean I will have to install all three versions of Word on the server? Or just Word 2010? Tools/Environment: Lucene.NET 2.3.1.3

How to position Outlook 2007/2010 VSTO Context Menu Button?

只愿长相守 提交于 2019-12-04 09:26:37
I have an Outlook 2007/2010 add-in where I have successfully added a context-menu button to the explorer. The button itself is displayed correctly and working fine however I am unable to position it above the built-in controls on the context-menu, it is always added to the bottom. I have created the same button using VSTO 3.0 for an Outlook 2003 add-in and the same code creates a button that is at the top of the context menu above the 'Open' button. My code is below void Application_ItemContextMenuDisplay(CommandBar CommandBar, Selection Selection) { if (Selection.Count != 1) return;

Re-enable VSTO add-in that is disabled by the Application due to multiple errors

半世苍凉 提交于 2019-12-04 08:59:05
I am writing and debugging an Excel VSTO Ribbon addin and it sometimes crashes due to errors in code. When Excel finally decides it's too much and asked me whether I want to permanantly disable it, I ACCIDENTALLY clicked yes. Now no matter what I do, I cannot get the addin to automatically load on Excel startup. I go to COMs AddIn dialog and set the checkbox; deleted the registry settings manually; cleaned the project in Visual Studio and rebuilt it -- no use. Where should I configure to make it auto load my VSTO again? Thanks in advance. btw, it's Excel 2010 on my dev machine. You have made