outlook-addin

How can I reliably get the object of a contact context menu in an Outlook 2013 addin?

六月ゝ 毕业季﹏ 提交于 2019-12-02 03:46:33
I am adding an entry to the context menu for a Contact in Outlook 2013 following the example in this article . Here is the XML: <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load"> <contextMenus> <contextMenu idMso="ContextMenuContactItem"> <button id="MyContextMenuContactItem" label="Do something..." onAction="OnDoSomething" insertAfterMso="DialMenu"/> </contextMenu> </contextMenus> </customUI> The entry shows up in the menu properly, and when I click it, my event handler is executed: public void OnDoSomething(IRibbonControl control) { object context =

Get named MAPI Property from MailItem in C#

时光毁灭记忆、已成空白 提交于 2019-12-02 02:56:40
问题 I'm developing an Outlook 2010 custom plugin in C#. This is my first time using C# (I'm a java guy normally). There is a named (custom) MAPI property on a message that I would like to access and am having trouble doing so. My understanding is that in Outlook 2007 the PropertyAccessor object was introduced which allows easy access to named MAPI properties. I followed the instructions from the following documentation: http://msdn.microsoft.com/en-us/library/ff868915.aspx I can see the named

Programmatically encrypt Outlook email using Inspector

旧时模样 提交于 2019-12-02 02:21:23
I'm using C# with Outlook Object Model (Redemption is not an option for me due to licensing) and I'm having difficulty programmatically encrypting an email message before sending it. I can successfully get a reference to the CommandBarButton which supposedly represents the Encrypt button (Id 718 according to online examples), but I cannot programmatically depress it. I tried using both the CommandBarButton Execute() method and using SendKeys (not sure if sendkeys is even valid in this context). All debug.writeline statements show that the button is in the msoButtonUp state. I've been playing

VSTO Outlook integration - Outlook shutdown event for synchronization

僤鯓⒐⒋嵵緔 提交于 2019-12-02 00:34:21
I'm working on a VSTO Outlook 2007 add-in that basically synchronizes Outlook data with web service. There are three types of synchronization that I want to have in the app: startup sync, manual sync and sync on shutdown. The first two as simple and are already done. However I have problems finding an appropriate event to fire to handle my sync on shutdown. I tried hooking to the following two events but it seems that they are fired too late when add-in doesn't have access to Outlook data and this just doesn't work: ((Outlook.ApplicationEvents_Event)Application).Quit (this one fires first, but

Save Email Upon Send in Outlook Add-In

守給你的承諾、 提交于 2019-12-01 23:42:34
I'm making an Outlook Add-in (Visual Studio 2010, .NET 4.0, C#), and I would like to automatically archive a user's email after they send it. What I have so far is the following: private void ThisAddIn_Startup(object sender, System.EventArgs e) { //Create an event handler for when items are sent Application.ItemSend += new ApplicationEvents_11_ItemSendEventHandler(saveEmail); } private void saveEmail(object Item, ref bool Cancel) { } What I've found through debugging is that my saveEmail method fires off right before the email actually sends. This is OK, ideally I would like it to be fired off

Call Outlook VBA code from c#

倖福魔咒の 提交于 2019-12-01 22:43:26
In visual studio I am creating an addin, in the addin_startup I am setting an Outlook application to app = (Microsoft.Office.Interop.Outlook.ApplicationClass)(Marshal.GetActiveObject("Outlook.Application")); then I am calling a runMacro function which I got from msdn private void RunMacro(object oApp, object[] oRunArgs) { try { oApp.GetType().InvokeMember("Run", System.Reflection.BindingFlags.InvokeMethod, null, oApp, oRunArgs); } catch (Exception e) { MessageBox.Show(e.GetType().ToString()); } } I pass this function, my Outlook app object and the name of the macro to run in an array, as so...

Outlook Application_NewMailEx not working on startup

依然范特西╮ 提交于 2019-12-01 22:37:21
I am using a Application_NewMailEx to treat all emails received. It works fine on emails received while Outlook is open. However on startup, the Application_NewMailEx does not get called by received emails. I tried using a Application_Startup but it is called before emails are received ==> does not work. There is no application.ontime to delay the startup macro... Application_NewMail does the same. How can it be done? Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) INIT_FOLD TreatMsg Application.GetNamespace("MAPI").GetItemFromID(EntryIDCollection) End Sub NewMailEx event

Outlook web add-in manifest change to support mobile devices (mobileFormFactor) installation fails

喜夏-厌秋 提交于 2019-12-01 13:55:29
I'm trying to enable outlook web add-in for mobile by making below changes in manifest file but the installation fails and throws below error. Error Message: Manifest file: <?xml version="1.0" encoding="UTF-8"?> <!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8--> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp"> <!-- Begin Basic Settings: Add-in

Outlook web add-in manifest change to support mobile devices (mobileFormFactor) installation fails

无人久伴 提交于 2019-12-01 13:39:07
问题 I'm trying to enable outlook web add-in for mobile by making below changes in manifest file but the installation fails and throws below error. Error Message: Manifest file: <?xml version="1.0" encoding="UTF-8"?> <!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8--> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas

Outlook Add-in not opening the default browser when clicking on link inside the addin

 ̄綄美尐妖づ 提交于 2019-12-01 12:51:35
Background We are having users complain about links ( <a href="..."> ) from our Outlook addin not opening in their default browser. Some see that Google Chrome (default) is opening, which is the intended behavior. But some see that IE is opening regardless of what the default browser is. I suspect this may have something to do with the version of Outlook - but I haven't been able to pinpoint how and what. Maybe it has got something to do with the IE version on the computer since the addin window should be running in IE. Perhaps even the version of Windows. The users that have seen the issue so