vsto

Detect when rows have been deleted by user in Excel 2003

こ雲淡風輕ζ 提交于 2019-12-11 09:16:50
问题 I have a C#.Net add-in to Excel 2003. I am hoping there is a hook (event?) to which I can attach, to detect when the user has deleted a row or rows from the active worksheet, as some caches will need to be recomputed or discarded when this happens. Is there any such hook or event? If not, is there a way of achieving what I want? 回答1: Unfortunately, there doesn't appear to be a way to detect when a row is deleted. According to the Worksheet event list, you could use the Change event to figure

WCF change address at runtime exception

女生的网名这么多〃 提交于 2019-12-11 09:10:05
问题 I have a problem connecting to WCF Service with custom endpoint. I have excel addin that communicates with database via WCF Service. I created service and everything works fine. WCF Service is referenced in ServiceReference of my Excel addin project. But now, I want to have an option to set server where WCF service is running. So I let user to input the service URI and I'm trying to create ServiceClient with binding and EndpointAdrress. But if I create ServiceClient with EndPointAddress of

Changing the VSTO tab's visible property through the Workbook_Open event

断了今生、忘了曾经 提交于 2019-12-11 09:09:46
问题 I have written the Ribbon.xml file for an Excel VSTO project. The tab element looks like this: <tab id="myId" idMso="TabAddIns" label="My Tab" visible="false"> When a workbook is opened, I want the tab to be hidden by default, which is accomplished through the visible property being set to false. Next, I want to change the visible property to true in the Workbook_Open event. This is where I'm stuck. I wouldn't think this would be hard, but I've spent a couple hours googling for the answer. It

C# Windows Forms - How to programmatically set image preview for file folder (VSTO 2010)

限于喜欢 提交于 2019-12-11 08:54:28
问题 Windows Forms - VSTO - Outlook Background - I am creating a digital archive add-in for Office where the user can search the database for the client (whom the document belongs to) and it will save the file to the appropriate folder(s) based on the nature of the file. So far this is working for Word as planned but I am now using Outlook which has more to consider (attachments, message body, etc.). I have got it working so far that the attachments are saved into a temporary folder (which is

Intercept Save event in Word 'Save As' dialog

佐手、 提交于 2019-12-11 08:49:24
问题 In Word, I have an open document - I navigate in the 'Save As' dialog to a directory and select an existing file. When I now click 'Save' instead of 'Cancel', I get the message if I want to overwrite/merge the existing document. Is it possible to intercept the 'Save' event in the 'Save As' Dialog so that I can change the file name of the open document, suppressing the overwrite/merge message? Any suggestions are greatly appreciated! 回答1: Yes, it is totally possible to intercept Word commands.

Adding content control throws an exception dynamically

六眼飞鱼酱① 提交于 2019-12-11 08:30:36
问题 I am fairly new to Word Addin development. Fortunately I was able to do almost everything but stuck at some simple issue I belive. I want to insert plain text controls dynamically at the selected range. For this I am using the following: currentDocument = application.ActiveDocument; foreach(var field in myFieldsList) { Microsoft.Office.Interop.Word.Range rng = currentDocument.ActiveWindow.Selection.Range; object oRng = rng; var contentControlPlain = application.ActiveDocument.ContentControls

Outlook 2010 Context Menu For Embedded Attachments - idMso?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 08:15:28
问题 I am working on Otlook 2010 add-in and currently customizing Ribbon UI. So far so good, but I have one problem with customizing context menu for embedded objects in mails. I have tried many idMso context menus, but none of them is working. Do anyone have experience which idMso is context menu shown below or how to add new button there ? Sample of my custom-ribbon.xml: <?xml version="1.0" encoding="utf-8"?> <customUI onLoad="OnRibbonLoad" xmlns="http://schemas.microsoft.com/office/2009/07

Excel VSTO Add-In: Cannot reactivate Excel after MessageBox.Show(“Test”);

不问归期 提交于 2019-12-11 08:07:00
问题 I am implementing a VSTO Excel Add-In which displays some modal dialogs. These dialogs are not shown as own windows in the windows taskbar. But under certain circumstances these dialogs are not are vanishing from the top of Excel and cannot got back by using the task bar! The whole story (reproducable with Windows XP - 7, Excel 2007 - 2010): I do open Excel and create two or more new workbooks I do show a modal dialog, let's say via "MessageBox.Show" I open "notepad" and maximize its window I

DataTable DataColumn ColumnName not displaying

别来无恙 提交于 2019-12-11 08:03:42
问题 I am new to VSTO and am encountering an issue I can't seem to figure out. I am trying to display a simple table in Excel 2013 and everything populates, except the column display names come out to be "Column1, Column2, Column3". Here is my code: var worksheet = Globals.Sheet1; worksheet.Cells.Clear(); var table = new DataTable("Users"); // Set Columns var columns = new List<DataColumn> { new DataColumn("Staged") { ColumnName = "Staged", Caption = "Staged"}, new DataColumn("FirstName") {

Excel displays #Value! when regional setting changed to non-english

。_饼干妹妹 提交于 2019-12-11 08:00:04
问题 I just came cross an issue where Excel would display #Value! when regional setting was set to non-English format. (Control Panel-> Region and Language-> Pick Non-English Format from the list) It's fine if user selects English. All the UDF results will come through and get displayed correctly in the cells. It just wouldn't work for non-English ones. I have had a look at some of possible solutions online, like these ones: http://support.microsoft.com/kb/320369 http://msdn.microsoft.com/en-us