add-in

Preventing Excel from updating the screen in C#

倾然丶 夕夏残阳落幕 提交于 2020-01-15 03:26:13
问题 I am writing an add-in in VIsual C# for Excel 2010. This add-in retrieves some data from a we service and writes the results into cells of a certain spreadsheet. However I don't want Excel to display filling the cells with values as this takes a lot of time. So I tried the following piece of code: ExcelApp = (Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application"); ExcelApp.ScreenUpdating = false; GetFolderTreeRecursive(FolderTree); ExcelApp

DI (Autofac) in a plugin architecture: Is one separate DI container per plug-in OK?

倾然丶 夕夏残阳落幕 提交于 2020-01-14 07:51:33
问题 I am trying to introduce DI (with Autofac) into an existing Windows Forms application. This application has a basic plug-in architecture where each plugin displays its own form. On startup, the application scans registered assemblies for types that implement IPlugin , and then activates these using Activator.CreateInstance : public interface IPlugin { Form MainForm { get; } } I cannot change this given framework. This means, each plugin class is instantiated through non-DI means, and it seems

Writing an Addin or Plugin Framework in C#

此生再无相见时 提交于 2020-01-12 07:58:11
问题 I am writing an Addin Framework in C# and I'm wondering how I can make Addin's unloadable without requiring a restart of the application. I heard of AppDomains but how do these work? Can an Addin add extendability classes and be called in the Main AppDomain by Interfaces and still be unloadable and call cleanup code resulting in those classes being removed without that Assembly being in the Main AppDomain? Or are there other methods of achieving unloadable addins, but IIRC other then

Read the ActiveCell content in Excel using VSTO

限于喜欢 提交于 2020-01-11 10:44:11
问题 I'm trying to read the ActiveCell from within an Excel Add-in but not getting very far. Anyone any ideas? Excel.Window W = this.Application.ActiveWindow as Excel.Window; Excel.Range R = W.ActiveCell as Excel.Range; MessageBox.Show(R.Value2.ToString()); The Exception being thrown on the last line is: - Cannot obtain fields or call methods on the instance of type 'Microsoft.Office.Interop.Excel.Range' because it is a proxy to a remote object. I tried .Value, and it says: - Property, indexer, or

How to modify CommandBandLayout reg key value

爱⌒轻易说出口 提交于 2020-01-06 14:59:13
问题 How can I modify [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\CommandBar] CommandBandLayout value to make sure my addon is first in the command bar? any help here appreciated Thanks, Manoj 回答1: You don't. Mucking with internal data structures can corrupt IE state and subsequently get your product blocked as malware. 回答2: this can simply be done by making a .reg file. This file can be used to modify the registry It should go like this: Regedit version Registry path

Adding controls to a form when I only have the reference to it’s EnvDTE

為{幸葍}努か 提交于 2020-01-06 12:50:30
问题 I am writing na Add-In for Visual Studio 2010, and I want it to add controls to an existing Form in an existing Project in an existing Solution, and I already have references to all of them. As I have the reference to the Project Item that represents the file of the form, I want a reference to the Form per se, then I’ll be able to do anything to it (changing properties, and adding controls). I have tried some approaches, though I must admit I haven’t ran out of tries. But since this is quite

Adding controls to a form when I only have the reference to it’s EnvDTE

亡梦爱人 提交于 2020-01-06 12:50:09
问题 I am writing na Add-In for Visual Studio 2010, and I want it to add controls to an existing Form in an existing Project in an existing Solution, and I already have references to all of them. As I have the reference to the Project Item that represents the file of the form, I want a reference to the Form per se, then I’ll be able to do anything to it (changing properties, and adding controls). I have tried some approaches, though I must admit I haven’t ran out of tries. But since this is quite

C# Outlook AddIn: How to determine to which calendar an AppointmentItem belongs?

≯℡__Kan透↙ 提交于 2020-01-05 13:01:28
问题 I want to determine to which calendar an AppointmentItem belongs. The scenario is as follows: An exchange administrator can have privileges to create appointments for conference rooms (by simply creating an appointment in the conference rooms calendar) and for himself (in his own calendar). How do I determine wether the item that the administrator currently looks at (inspector) is from the conference rooms calendar? Thanks a lot! 回答1: If this is Outlook 2007-2010, compare MAPIFolder.Store of

C# Outlook AddIn: How to determine to which calendar an AppointmentItem belongs?

别说谁变了你拦得住时间么 提交于 2020-01-05 13:00:15
问题 I want to determine to which calendar an AppointmentItem belongs. The scenario is as follows: An exchange administrator can have privileges to create appointments for conference rooms (by simply creating an appointment in the conference rooms calendar) and for himself (in his own calendar). How do I determine wether the item that the administrator currently looks at (inspector) is from the conference rooms calendar? Thanks a lot! 回答1: If this is Outlook 2007-2010, compare MAPIFolder.Store of

How can I hide Protected Excel AddIn Functions from Appearing in Insert Function Dialogue Box?

不羁岁月 提交于 2020-01-05 04:51:13
问题 I recently discovered, however, that all public functions are displayed in the "Insert Function" dialogue box when you select "User Defined" in the "Or select a category" drop down list. This happens even if you password protect the project and lock it for viewing. To get to the "Insert Function" dialogue box press Shift-F3. Private functions are not displayed in the list, but it is impossible to make all functions private, especially if you want to reuse them across modules. Is there a way