vsto

Can't find the list of most (all?) tab names for the ribbon in Office

一世执手 提交于 2019-12-05 01:18:33
问题 After some heavy googling, I've concluded that I'm unable to locate information on the id names for the different components of the ribbon in Office. For instance, even though the following XML works, I need to hide the add-in error display due to TabMail being at fault when a new email is being created. It's my understand that it's because I currently target all windows in Outlook but should be only targeting the main one. When a new email is being created, my add-in tries to insert itself

VSTO custom taskpane on multi DPI system shows content twice

若如初见. 提交于 2019-12-05 00:11:53
I am building an office addin using VSTO. On systems with multiple monitors with different DPI settings, the contents of my custom task pane is drawn twice on the monitor with the higher DPI settings: Only the smaller version is actually responding to user input. The larger version seems to be simply an upscaled image. I have tried playing around with diverse DPI related settings like: AutoScaleMode on my user control. I tried all options, no change. Setting the process to DPI aware - or not - using SetProcessDpiAwareness . I tried all options, no change. Using an app.manifest and setting

Adding items to RibbonDropDown at runtime

两盒软妹~` 提交于 2019-12-04 23:46:53
So I have a dropdown menu in a ribbon with contents that can be changed while it is being used. Outlook is also happy to let me 'add' or 'insert' items into it, as long as I do not add more than 1 item. If I try to, I'll be told that the index is out of bounds rather than expanding the upper bounds for me. I find that if I insert it into the collection in the designer portion of the code, it will work fine, but designer code is only run once, unless I Dispose the ribbon and re-create it. Any ideas regarding how I can get this working Generally speaking, VSTO wants you to completely describe

How to mock rows in a Excel VSTO plugin?

巧了我就是萌 提交于 2019-12-04 23:40:52
I am trying to put a mocked Range (which contains cells with values) inside the rows of a new Range . But when I try to access a specific element from the Range , a exception is thrown. I've tried everything, does anyone have a idea what I am doing wrong here? Exception Message: Test method xxx.MockUtilsTest.MockRowsTest threw exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot apply indexing with [] to an expression of type 'Castle.Proxies.RangeProxy' Test [TestMethod] public void MockRowsTest() { var row1 = MockUtils.MockCells("test_row_1", "test_row_1"); var row2 =

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

北城以北 提交于 2019-12-04 23:27:17
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.SetProperty("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", false);

Hooked events Outlook VSTO continuing job on main Thread

橙三吉。 提交于 2019-12-04 22:38:32
I have developed an Outlook VSTO addin. Some tasks should be made on a background thread. Typically, checking something in my local db or invoking a web request. After reading several posts, I dropped the idea of calling the Outlook Object Model (OOM) in a background thread. I have some wpf controls and I successfully managed to use the .NET 40 TPL to perform the async task and when completed to "finish" the job (i.e. accessing the UI or the OOM) in the Main VSTA Thread. To do so I use a syntax of the form: Task<SomeResult> task = Task.Factory.StartNew(()=>{ //Do long tasks that have nothing

How to get current or focussed cell value in Excel worksheet using C#

自古美人都是妖i 提交于 2019-12-04 22:31:35
问题 Please help me through a C# code that in VSTO Excel. Wherever I selected a cell the respective column gets focused, I need to get the Column value (column) and Row value(row no) on excel worksheet wherever I focus. How can I do the same through code? How do I get the focused or current cell's column value in VSTO excel using C#? Also, I would like to learn VSTO Excel using C# so some good free/downloadable ebooks and/or any web links suggestions are welcomed. 回答1: Excel.Range rng = (Excel

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

浪子不回头ぞ 提交于 2019-12-04 22:13:21
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. The control type you're looking for is dynamicMenu Here is the ribbon XML: <dynamicMenu id="mycustomid"

How to return XLOPER (Excel Variable) to VBA directly from a c++ dll?

爷,独闯天下 提交于 2019-12-04 22:07:16
I have no idea how to handle XLOPER type variable in VBA. There are plenty of web pages explaining the relationship between Xloper variable , c++ DLL and XLL add-in, however i need to write c++ function in a dll returning a xloper directly to VBA without XLL framework. (No need of User Defined Function since functions from the dll will be called by the VBA code - not by Excel users). Indeed i'm coding a Excel VSTO and i need to call c++ code from it. I found that xloper variable are very useful for XLL so i would like to use this variable type in VBA/VB.Net directly. So is it possible? my

Clear Microsoft Office Add-Ins cache

爱⌒轻易说出口 提交于 2019-12-04 20:41:00
I wrote some code in an add-in for Microsoft PowerPoint 2007. I executed it. It said there was a problem. With help from a fellow member here , I rectified the problem. I compiled the new code and ran it. It still considers the old code and ignores the new one and still throws the same problem. The two versions of code are radically different in that they do not share the variables that the problem reports, thus my reason for being sure that the problem isn't in the code now. Clearly, MS Office is retaining an older version of the binaries somewhere in some cache. How do I clear that and allow