add-in

ItemChangeEvent fired multiple times

青春壹個敷衍的年華 提交于 2019-12-24 15:42:52
问题 I work on Outlook addin that is connected to an Owncloud (Caldav, Cardav). I use eventhandlers to detect when a user delete, create or update a contact item. In this case this will notify the server and do an update on his side. storage.Aitems[storage.Aitems.Count - 1].ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(contact_item_add); storage.Aitems[storage.Aitems.Count - 1].ItemChange += new Outlook.ItemsEvents_ItemChangeEventHandler(contact_item_change); ((MAPIFolderEvents_12_Event

What is the current state of the art in developing MSFT Office macros in a NON-VBA language?

末鹿安然 提交于 2019-12-24 15:08:36
问题 Long ago writing VBA macros for MSFT Office was part of my job. Now it looks like I may be traveling down that road again, and I have not touched MSFT Office for anything serious in years. Is VBA still the de-facto standard for creating msft office extensions? Is it possible to write (non-second-class-citizen) MSFT office extensions in any language besides VBA yet? 回答1: Macros are still good for prototyping. However, since they are an easy attack vector for malicious code I would try to avoid

Outlook ItemChange Handler (makes item unchangeable)

﹥>﹥吖頭↗ 提交于 2019-12-24 10:18:23
问题 i write a Outlook Addin which should change an Contactitem after write. i use ItemChange EventHandler folder.ItemChange += new Outlook.ItemsEvents_ItemChangeEventHandler(ContactItemChange); but when i am editing an item, my Code always run in background and so i can't editing my Item. I have tried item.AfterWrite and item.Write but the Event will never Triggered. private void ContactItemChange(object item) { if (item is ContactItem) { ((ContactItem)item).AfterWrite += ThisAddIn_Write; } }

Excel.Application.SelectionChange fires only once

放肆的年华 提交于 2019-12-24 09:47:59
问题 I'm getting only the first event notification, and nothing happens after. Any ideas? UPD: I've found a strange thing. My code for event handler looked like this: var cell = range.Cells[1, 1]; var rangeName = cell.Address[false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing]; I've changed it in this way, adding explicit type cast: var cell = (Range)range.Cells[1, 1]; var rangeName = cell.Address[false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing]; And now my event

VBA add-in: how to “embed” the required reference libraries? Getting “Compile error in hidden module” when sending functional add-in to other users

眉间皱痕 提交于 2019-12-24 06:45:19
问题 I wrote a powerpoint add-in that works well on my local computer. Yet when I email the file to others, all of a sudden half the functionalities no longer work and show the compile error as listed in the subject line. Digging a bit deeper, it appears the issue is that the client computers do not have the correct reference libraries (e.g., Excel 14.0 Object Library, Outlook, Access, etc.). I have these libraries correctly referenced when writing the add-in as a pptm file, but imagine that when

An Excel Ribbon via VSTO solution explorer folder structure vs. path in code

倖福魔咒の 提交于 2019-12-24 05:44:12
问题 I am following this tutorial for adding an Excel Ribbon via VSTO. My problem is exactly the same as this one. I have visited the links, but it didn't help me. The answer is very poor and leaves me clueless in terms of how to solve this issue. If I add a Ribbon Item straight to the Project I am able to compile and run the add-in. However, when I add a new folder then stick a new item(Ribbon) inside of that folder I am getting an error. I think it's related to the path'ing. Somewhere, somehow I

Application.ActiveWorkbook is null in Excel Addin

浪尽此生 提交于 2019-12-24 05:40:11
问题 I am writing an Excel Add-in. Following is my code private void ThisAddInStartup(object sender, EventArgs e) { Excel.Sheets sheets = Application.ActiveWorkbook.Sheets; _worksheet = (from Excel.Worksheet sheet in sheets where sheet.Name.Contains(SheetName) select sheet).FirstOrDefault(); Application.SheetChange += ApplicationSheetChange; } When I debug, everything works great. But When I open an excel file directly from my hard drive then I am getting Application.ActiveWorkbook as null . Can

Can I create a Visual Studio 2010 Add-In that Uses a WPF Display?

若如初见. 提交于 2019-12-23 13:26:29
问题 We're working on creating a specialized graphical editor for our enterprise applications. We've looked at and rejected DSLs. Ideally I'd like to have the main interface of the editor be docked like the code windows and use WPF for drawing. Can anyone point me to some documentation to get me on the right path? Thanks. Colin. UPDATE: It's beginning to look like "no." From http://msdn.microsoft.com/en-us/library/bb166228.aspx: "Document windows are created by implementing an editor. The

Get Access property of a CodeElement

只谈情不闲聊 提交于 2019-12-23 12:37:02
问题 I'm writing an Add-in for VS 2010. Can't find answer for a question - How can i get the Access property of a CodeElement if it has that one. I was trying reflection, but no results. Ex. CodeElement is a class method public void GetAccess (CodeElement codeElement) { object code = codeElement; Type t = code.GetType(); t.GetProperty("Access") = vsCMAccess.vsCMAccessPublic; } But it doesnt work.. Help, please! 回答1: Access is only available on some types of CodeElements, so you'll need to check

How to get stack trace of a running process from within a Visual Studio add-in?

空扰寡人 提交于 2019-12-23 10:56:31
问题 I am writing a Visual Studio add-in in C# which will run while I am debugging a process in the same Visual Studio window and I need access to that the process' stack trace from within my add-in. I tried putting this code into my add-in but it returns the add-in's stack trace, not the process I am debugging. System.Diagnostics.StackTrace stacktrace = new System.Diagnostics.StackTrace(true); System.Diagnostics.StackFrame stackframe = stacktrace.GetFrame(0); Any help would be appreciated. 回答1: