vsto

VSTO Outlook - Contact iteration is SO SLOW!

怎甘沉沦 提交于 2019-12-06 15:49:23
I'm working on an outlook add-in and I have a dialog window that allows the user to select contacts. I havent been able to find a way to use the outlook contact window so I am looping through the ContactFolder.Items and doing my work that way. The problem is that I have to handle up to 70K contacts. I tried multi-threading and many other things but it is just so slow. It takes 15 seconds to load 30k contacts. I can load and bind 500k POCO objects in milliseconds but when I need to get the contact items from outlook it just takes forever. The problem seems to be when you actually need to get a

Tag Outlook MailItem with ID number before send without causing TNEF (RTF) send

本小妞迷上赌 提交于 2019-12-06 15:45:11
问题 I have an Outlook add-in which assigns a UserProperty to a MailItem before it is sent: Outlook.UserProperty prop = mail.UserProperties.Add("XXXX", Outlook.OlUserPropertyType.olText); prop.Value = "YYYY"; It is known (see Stop Outlook from converting HTML to RTF for example) that doing this causes the email to be sent using TNEF (ie RTF format, the dreaded winmail.dat). My question is, is it safe to simply un-set the TNEF property? The following code will do that: mail.PropertyAccessor

How to create a dynamic submenu in contextmenu for outlook (VSTO)

十年热恋 提交于 2019-12-06 15:01:50
问题 I have a ribbon xml where I want to add something similar as in the picture. I tried create a button and connect the menu to the button but I never got the arrow indication there is a underlying menu. I have no faith at all in that button is the correct element to use. Been googling for hours now and would be happy if anyone can send me in some kind of direction. There is no problem for me to add the element in the context menu, the problem is the dynamic menu linked to the first element. 回答1

How to search for the name of the UserProperty in Outlook.MailItems, not their value

大城市里の小女人 提交于 2019-12-06 14:56:18
BACKGROUND: Currently I am searching Outlook.MailItems where their UserProperty (here, "IsProcessed") is equal to its propertyValue (here, true or false). string propertyValue = "true"; string filter = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/IsProcessed LIKE \'%" + propertyValue + "%\'"; I am using this filter string in advancedSearch link to doc PROBLEM STATEMENT: My usecase is to search if these mailItems have any UserProperty assigned where name of UserProperty = "IsProcessed". Is there any way to do so using similar DASL filter string? Thanks. No,

How to dected Excel was starting by automation (VSTO Addin context)

点点圈 提交于 2019-12-06 14:51:39
Context: I'm running a VSTO Excel application context addin and I will load my addin also when MS Excel was started by an other process for automation in visible mode. So now, it's necessary to know if MS Excel was started by an other process with automation e.g CreateObject() ExcelApplicatoin.Visible =true ("/automation -embedding") At the the moment, I evaluate the following Excel Property: ThisAddIn.Application.UserControl But when MS Excel is started during CreateObject the property is alsways "False". Does have anyone any idea to solve this problem? I have no other properties found to

How to add options hyperlink into Excel Function Arguments Window just like bloomberg's BDH function?

爱⌒轻易说出口 提交于 2019-12-06 11:00:56
问题 I have developed a excel UDF. One of the UDF parameters has known possible values (A, B, C). So instead of asking all my users to find out what the possible values are I want to provide a option1 (hyperlink) in excel function wizard just like the Bloomberg's BDH function as shown in the screenshot. I know I have to somehow hook upto win32 api and override the call/window when the function wizard is invoked. When I look into SPY++ I see that there is a insert function window and function

How can I find out about undocumented .NET / COM library functions?

一笑奈何 提交于 2019-12-06 10:23:39
How can I find out the properties and methods of COM objects returned from some .NET functions, which do not appear to be documented? In the particular example I'm looking at, I'm inserting a picture into Excel using a function like: Set NewPic = ActiveSheet.Pictures.Insert(FileName) (See the SO post on this here .) However, the MSDN documentation for this function only says that Worksheet.Pictures returns an Object, and when I put a watch on the variable during debugging its type is System.__ComObject. Can I find out what other properties and functions might be available for that class (for

WPF window invoked from Excel, Context menu shows and disappears immediately

扶醉桌前 提交于 2019-12-06 09:55:50
I have a WPF window which has a ItemsControl which contains list of User controls. Each user control has a button and a list box. On the button i have a context menu which lists some option. When i ran the WPF window directly the context menu works perfectly. Now i have integrated the WPF form in a excel add in. on click of a button in addin the window show up. This works fine But when the window is called from addin and i right click the button to see the context menu options, it comes and immediately disappears. Any idea what i am missing here ? Shankar I had an Excel-Add-In using WPF

Excel 2010 AddIn not loaded when Excel-Workbook opened with double click

亡梦爱人 提交于 2019-12-06 08:28:22
I wrote a Add-In for Excel 2010. It works fine if I open Excel from Start menu. But just if I double click on a Excel Workbook, the AddIn can not be loaded. I checked it in ThisAddIn.cs , the method InternalStartup() has not been involved. Can somebody help me? Thanks! But opening file from command line "excel.exe table1.xlsx" works! 来源: https://stackoverflow.com/questions/10978625/excel-2010-addin-not-loaded-when-excel-workbook-opened-with-double-click

Form.Show(IWin32Window) method in Excel VSTO causing ThreadAbortException on application close

核能气质少年 提交于 2019-12-06 08:15:35
I have an excel add-in and i have a form that i would like to be front of excel window. I use NativeWindow for this purpose on excel ribbon menu button like this: public partial class MyRibbonMenu { public List<Form> Forms = new List<Form>(); private void button1_Click(object sender, RibbonControlEventArgs e) { // initialize form Form frm = new Form(); frm.Text = "Test Form"; Forms.Add(frm); // create the native window handle NativeWindow nw = new NativeWindow(); IntPtr iptr = new IntPtr(Globals.ThisAddIn.Application.Hwnd); nw.AssignHandle(iptr); // when close the form release the handle frm