vsto

Create Excel Add-in without VSTO

拈花ヽ惹草 提交于 2019-12-11 07:32:49
问题 I have used VS 2010 to create an Excel 2007 Add-in with C#. The add-in is a TaskPane-based UI. Works great, love it. However, my users do not have Admin access and cannot install the add-in because VSTO is required. Is there a way to create/port this add-in to a normal COM based add-in without this show-stopping reference to VSTO? 回答1: They shouldn't necessarily require admin rights just because you use vsto. Make sure that the addin is being installed "Per user" instead of "per machine". 回答2

Word Add-in keeps Word process alive when document is embedded via OLE

有些话、适合烂在心里 提交于 2019-12-11 07:16:56
问题 I have built a Word Add-in which has to do a task when the user closes the document. I installed an event handler for the DocumentBeforeClose event of the Application object to do that. The problem is that the event handler appears to prevent the Word process from exiting when I embed an existing Word document in an Excel workbook for example. The problem occurs when I embed the document in Excel via the Ribbon Insert > Object > Create from File and then select a Word document. The document

Setting Caliburn IWindowmanager's Owner Property to Excel with handle HWND

陌路散爱 提交于 2019-12-11 07:13:51
问题 I have an Excel Vsto addin application in which I host WPF application build using Calibrun Micro Autofac.I have a dialog popping up the excel and I want that Pop up window's Owner to be set to this excel window.Only way I see doing this is using WindowInteropHelper Class which needs Window instance. And I am using settings like this : dynamic settings = new ExpandoObject(); And I show window like this : windowManager.ShowDialog(viewModel, settings: settings); So What should I do to set the

Outlook Add-In - Enable/Disable Button during Runtime/from Code

久未见 提交于 2019-12-11 07:01:01
问题 Initial Situation: We are developing an Add-in for Outlook 2010 in C# with VS.NET 2010 based on Framework 4.0, VSTO, DevExpress WinForm Controls. In Designer we have a Ribbon with a RibbonTab, then a RibbonGroup then a RibbonButton. We're consuming WebServices from within this Outlook Add-in. Objective: We need to enable/disable the RibbonButtons when the WebService is available/unavailable (from/out of the code) we've found the following links: Links Ribbon Object Model Overview: http://msdn

How to iterate through open forms in a VSTO add-in?

元气小坏坏 提交于 2019-12-11 06:39:55
问题 I have a VSTO add-in for MS Project that opens forms where the data is related to the specific project file that was active when the form was open. It is possible to open one form related to one project file, while having another different form open that is related to a second open project file. When I close a project file I would like to check each open form, and close it if the forms base project ID equals the project ID of the project file that is closing. How do I access the open forms

Set Focus on Excel Application

一曲冷凌霜 提交于 2019-12-11 06:27:55
问题 How to set focus on Excel Application object in vsto C# i have been searching for it but didn't have any success 回答1: Try this code Process[] processes = Process.GetProcessesByName("excel"); foreach (Process p in processes) { if (p.MainWindowTitle.Contains(fileName.Substring(fileName.LastIndexOf("/") + 1))) { SetForegroundWindow(p.MainWindowHandle); } } 回答2: The solution in my VSTO application is: [DllImport("user32.dll", SetLastError = true)] public static extern bool BringWindowToTop(IntPtr

Best way to manage the ActiveWorkbook in a VSTO Excel Addin application

五迷三道 提交于 2019-12-11 06:05:57
问题 I've developed a rather intensive Excel Addin (VTSO based) that creates an in-memory datatable from database query, and then binds this to ListObject. There are a bunch of other functions available when this ListObject is created (including event handlers that update calculations in the datatable, and custom task panes that popout to show additional information about a cell). The Addin works well, although I'm getting issues when users open other Excel workbooks or additional instances of

How to create silent installer for Office AddIn

末鹿安然 提交于 2019-12-11 06:02:24
问题 I have a problem to create a silent installer for Outlook Add-In developed using VSTO in C#. The installer is a outlookaddin.vsto generated by clickOnce. This add-in will be published by SCCM in several computers and I need a that the installation be silently but when the package reaches to the final device appear the screen of "Microsoft Office Customization Installer" asking confirmation for install it. I need create a script with some kind of "autoclick" for clicking automatically on

Outlook VSTO TypeText(“text”) Throws “The TypeText method or property is not available because the document is locked for editing” Exception

一个人想着一个人 提交于 2019-12-11 05:38:33
问题 Calling TypeText("dummytext") on ActiveInspector WordEditor throws: The TypeText method or property is not available because the document is locked for editing. Here is my code: var inspector = myMailItem.GetInspector; dynamic w = inspector.WordEditor; dynamic wa = w.Application; wa.Selection.TypeText("sometext"); 回答1: I have seen lots of issues if using selection this way. This is how I would do it object link = url; object res = "url"; object missing = Type.Missing; // get active inspector

Copy emails from source folder if not existing in destination folder

北慕城南 提交于 2019-12-11 05:32:07
问题 I'm using Visual Studio to build an addin to copy emails. The condition is to check, according to SentOn/ReceivedTime , and copy only those emails from the source folder that do not exist in the destination folder. I tried below code but its gives me an error System.OutOfMemoryException Out of memory or system resources . Sub CopyMail(SourceFolder As Outlook.Folder, DestinationFolder As Outlook.Folder) Dim sMail As Object Dim dMail As Object Dim MailC As Object For Each sMail In SourceFolder