vsto

Unable to set the DisplayAlerts property of the Application class

谁说我不能喝 提交于 2020-01-15 03:49:08
问题 I am intermittently getting the following exception: It does not occur if I step through the code and I'm having trouble working out how to reproduce it reliably. The inner exception is null. I have search the web and found a C++ MFC programmer cam across the same thing but no answers: http://www.excelforum.com/excel-programming/555121-unable-to-set-displayalerts-property.html I also have read up on another possible cause unfortunately is unrelated as its to do with opening a spreadsheet via

How to understand Namespace of outlook 2007 data store

我们两清 提交于 2020-01-14 19:50:50
问题 Firstly , I am a freshmen to outlook add-in development,Recently I read some learning material from MSDN or other tutorial, The First thing makes me confused is if I want to find something like a certain Appointment or Meeting Request from inbox, I should firstly use Application.GetNameSpace(“MAPI”) to get a NameSpace instead of getting some kind of object like Folder or Appointment Collections and so on. I don't understand the Data Store Access pattern of Outlook 2007 in Add-in development.

How to best fetch a cell value from excel using VSTO?

十年热恋 提交于 2020-01-14 15:06:52
问题 I am trying to get cells from excel into csharp but not sure what's the best variable type to read it into. If I make the variable a string and the cell value is a double I get a parse error. If I make the variable double then when the cell is a string it wont work. Here's the code I am running: try { string i = Globals.Sheet1.Cells[7, 7].Value; double num; if (i == null) return; if (double.TryParse(i, out num)) { . . . } } catch (Exception e) { MessageBox.Show(e.ToString()); } 回答1: Make it

How to best fetch a cell value from excel using VSTO?

百般思念 提交于 2020-01-14 15:02:34
问题 I am trying to get cells from excel into csharp but not sure what's the best variable type to read it into. If I make the variable a string and the cell value is a double I get a parse error. If I make the variable double then when the cell is a string it wont work. Here's the code I am running: try { string i = Globals.Sheet1.Cells[7, 7].Value; double num; if (i == null) return; if (double.TryParse(i, out num)) { . . . } } catch (Exception e) { MessageBox.Show(e.ToString()); } 回答1: Make it

Excel.Range to String conversion in C#

不羁岁月 提交于 2020-01-14 09:06:48
问题 Using .NET's Office interop libraries, does anybody know the best way to convert back and forth between strings (eg "A57", "$L$2:$M:$3") and corresponding objects of type Excel.Range? Bonus points if it also works with "named ranges". 回答1: Use the Range property of a Worksheet object, and pass Type.Missing as the second parameter. For example: Range range = sheet.get_Range("$L$2:$M:$3", Type.Missing); This also supports named ranges. EDITED 回答2: As SLaks said, you can get a range object from

Excel.Range to String conversion in C#

偶尔善良 提交于 2020-01-14 09:06:07
问题 Using .NET's Office interop libraries, does anybody know the best way to convert back and forth between strings (eg "A57", "$L$2:$M:$3") and corresponding objects of type Excel.Range? Bonus points if it also works with "named ranges". 回答1: Use the Range property of a Worksheet object, and pass Type.Missing as the second parameter. For example: Range range = sheet.get_Range("$L$2:$M:$3", Type.Missing); This also supports named ranges. EDITED 回答2: As SLaks said, you can get a range object from

Problem after installing VSTO runtime 2010 and .Net framework 4

假如想象 提交于 2020-01-14 04:16:07
问题 Our entire team installed VS 2010(It has both VSTO runtime 2010 and .net framework 4).After installing that some of our developers are getting the below error (but for majority its working fine) while opening the deployed VSTO application from server developed in framework 3.5 and VSRO runtime 3: ** * ** Exception Text ** * **** Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization does not have the permissions required to create an

How do I create a custom Outlook Item?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 11:14:12
问题 I understand that Outlook has set items, i.e. Mail, Task, Calendar, Notes, etcetera. How can you create a custom Item that Outlook will recognize as the others? I know that when you add the Business Contact Manager it creates Items like "Opportunities" Can you override an Item, or inherit an Item and alter/add properties and methods? examples: olAppointmentItem 1 Represents an AppointmentItem olContactItem 2 Represents a ContactItem olDistributionListItem 7 Represents an DistListItem

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

…衆ロ難τιáo~ 提交于 2020-01-13 06:59:10
问题 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 回答1: 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

Spreadsheet Compare (Office 2013) automation from .NET application or VSTO add-in

橙三吉。 提交于 2020-01-13 00:30:14
问题 Is it possible to automate the new Spreadsheet Compare tool of Office 2013 from a .NET application or a VSTO Excel add-in by embedding some Microsoft assemblies? A similar question was asked for VBA programming and the response was no. I managed to execute the application "C:\Program Files (x86)\Microsoft Office\Office15\DCF\SPREADSHEETCOMPARE.EXE" in command-line with a text file as input argument containing two workbooks paths in separate lines, but it would be easier to call a method