add-in

calling C# from c++ com add-in

北城以北 提交于 2019-12-18 04:24:10
问题 I have a COM add-in written in C++ (not C++ / CLI). I want to call a C# library objects/methods from this C++ com library. I guess the CCW comes into picture here, which i am currently reading about. Are there any quick pointers to this stuff from your experience? Also, i have a method in my Com add-in that i would like my C# library code to call - i.e. a method pointer invocation. Can you help telling me how i can do this please - i.e. how do i go about passing the method pointer to the C#

How to get notification when a successful build has finished?

徘徊边缘 提交于 2019-12-18 04:04:12
问题 I'm writing an VS add-in and I need to run a certain method after a successful build. I've tried using dte.Events.BuildEvents.OnBuildDone but that event happens even if the build failed. Is there a property or some other event I should use? 回答1: The OnBuildDone event cannot tell you what happened. Some projects in the solution might have built properly, some didn't. You'll need OnBuildProjConfigDone instead. Fires for each project, the Success argument tells you if it worked. 回答2: Typically,

How to -> Visual Studio Add In Manager

心已入冬 提交于 2019-12-17 22:18:37
问题 How do I use the Add-In Manager in Visual Studio? Here is the problem and solution. I want to add this SmartPaster addin and need to get these 3 files listed in the Add-In Manager dialog? SmartPaster2010.AddIn SmartPaster2010.dll SmartPaster2010.xml Edit: Microsoft Add-In Registration says: To install the add-in on another computer, the .addin file must be placed in a location where Visual Studio checks for add-ins. These locations are listed in the Options dialog box, in the Environment node

How do I write an IE 8 Add-On in pure managed C#

三世轮回 提交于 2019-12-17 18:48:15
问题 I would like to write an add-on for IE 8, but I want to use pure managed C#. Is this possible yet? I know for the longest time we were talking only C++. 回答1: Ultimately, the C# will end up calling into IE8's COM functions. There's a framework called Spicie that makes this easier, and some other examples here: http://www.enhanceie.com/ie/dev.asp Generally, it's a bad idea to write browser extensions in .NET because there's a severe performance impact, and there's the possibility of runtime

Automation add-in vs. COM add-in

喜夏-厌秋 提交于 2019-12-17 17:48:28
问题 I am a newbie with add-in programming and need help with the following scenario: I have an C# Excel automation add-in that calls a few UDF s. I want to do a user name and password check during when the automation add-in loads for which a screen where the user can enter his details must pop up on load of the add-in. How can it be done using an automation add-in? How can event handling be done in general using automation addins ? I want some calculations to be done when the user presses F9 to

How to save options of a VSTO add-in in the currently open file?

若如初见. 提交于 2019-12-14 03:53:47
问题 I'm building a VSTO add-in for Powerpoint 2010 and the options the add-in sets apply to the currently open file instead of a per-user config. Can I save these options in the current file (I mean, add custom XML to the .PPTX file)? If so, how? Thanks for your help. 回答1: If your Options are not too complex, I would go for Document Custom Properties. The following question illustrates how to use Custom Properties with Excel, they are supported in PowerPoint as well so this should provide a good

How to get selected text from Word Document in C# based Word Add-In?

旧城冷巷雨未停 提交于 2019-12-13 18:39:41
问题 I am developing a MS Word Add-In. For which, I would like to know how to get the text that is currently selected in the word document and then perform my application specific action on it. Thank you, for your help. 回答1: In your Word add-in project in Visual studio use the following code on your trigger event to get the selected text: string selectText = string.Empty; Word.Selection wordSelection = this.Application.Selection; if (wordSelection != null && wordSelection.Range != null) {

how to create setup for excel addin?

懵懂的女人 提交于 2019-12-13 18:35:16
问题 I have a created an excel addin application in vb.net using vs2010.The application is working fine while running from IDE. Now I want to create a setup for the application to install the same addin in other system. How can I do this? I created a setup project and added the dll of the addin and created setup file. When I installed it in other machine, installation was succesful. However I could not see the addin in excel when i opened it. Can someone help me on this? 回答1: The list of Excel Add

Catch C# WPF unhandled exception in Word Add-in before Microsoft displays error message

放肆的年华 提交于 2019-12-13 16:16:23
问题 I am developing a Microsoft Word Add-in using C# and WPF. In one of my windows, a helper class is throwing an exception in an event. I want the exception to bubble up to the window level so that I can catch it and display an error message to the user. Because it's in an event in the helper class, I can't just surround a method call in the window code with a try/catch block to catch it. Application.Current returns null so I cannot use the Application Dispatcher. I can use Dispatcher

Application.COMAddIns Subscript out of range

送分小仙女□ 提交于 2019-12-13 16:14:55
问题 Following the sample case below https://msdn.microsoft.com/en-us/library/bb608614.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1 Run into a 'Subscript out of range' in Set addIn = Application.COMAddIns("ExcelImportData") New to VSTO and C#. How do I debug this? 回答1: If the add-in subscript is out of Range, it suggests that you've either made a typo in the name of the add-in while creating the VSTO project, or you've failed to open Excel using the debugger (which automatically loads the add