outlook-object-model

Ready event in Microsoft Outlook 2010?

ぐ巨炮叔叔 提交于 2020-02-07 07:47:50
问题 Is there an event in Microsoft Outlook 2010 which one can subscribe on, in order to known when Outlook has finished initializing and all components, folders etc. have been loaded? 回答1: Not sure about VSTO but good ol' COM addins get the StartupComplete "event" (via IDTExtensibility2 ) for exactly that purpose. 回答2: Ok, I found out what I needed to do... ... private void ThisAddInStartup(object sender, EventArgs e) { this.Application.Startup += ApplicationStartup; this.Application.ItemLoad +=

MAPIFolder deprecated so workaround for Outlook programming?

痴心易碎 提交于 2020-01-03 21:09:50
问题 MSDN says this of the MAPIFolder interface (Outlook programming with WPF): This interface is deprecated; do not use this interface. Instead use the interface Folder to access all method, property, and event members of the COM object Folder. I am trying to get the Drafts folder like so: Outlook.MAPIFolder oFolder = olNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts); How do I do the above without using the MAPIFolder (which is deprecated)? I guess I don't understand what MSDN is

No Application Quit event in Outlook?

一世执手 提交于 2019-12-30 09:05:33
问题 I'm using the 12.0 Interop library, which is the default for Outlook 2007. I'm actually aiming for Outlook 2003 to 2010 integration with a code example that registers to a quit event. Even though the docs say that there is an application Quit event for the Outlook app, I can't find it in the Outlook.Application object implementation. Visual Studio 2010 seems to identify Quit as a method: Question: How would one register to the Outlook application's Quit event? (if there is one, or any event

Error thrown when opening e-mails using outlook api

别等时光非礼了梦想. 提交于 2019-12-25 13:14:11
问题 Question: I get the following error message when opening what appear to be valid .MSG files using Outlook API to open emails: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E

How do I reliably tell that two Inspector references point to the same inspector instance?

末鹿安然 提交于 2019-12-23 03:19:14
问题 [continued from Is there a way to tell whether two COM interface references point at the same instance?] I've got references to Inspector objects from two different sources and need to be able to tell which item from one source corresponds to which item from the other source. However, none of the approaches I have been able to come up with so far worked (reliably): I couldn't simply compare the IUnknown interfaces as it seems that the Inspectors.Item() method is returning a reference to a

Email sent with Outlook Object Model stays in Outbox until I start Outlook

风格不统一 提交于 2019-12-13 06:47:37
问题 I'm trying to send emails from a .NET application using Outlook Object Model. My application displays the Outlook message window so the user can see what we're sending and edit it first. When the user hits the Send button, the Outlook window closes, and the message gets sent. This works perfectly as long as the Outlook application is already running. If the Outlook application isn't already running, the message gets stuck in the Outbox, and will not send until I start Outlook. When I start

How to Insert contacts into Outlook - C# 3.0

让人想犯罪 __ 提交于 2019-12-13 03:45:50
问题 Title of the question explains what I want to acheive. I know it can be done using Microsoft OUtlook object library 12.0 . But, I am looking for a managed option, or an XML import into outlook. Since, number of contacts can be in thousands. So, I am looking forward to the best approach. Any open/closed source library that you know. Please let me know. 回答1: You can use Redemption and its RDO family of objects - it directly uses Extended MAPI (the same API used internally by Outlook). 来源: https

Outlook Object Model - Hooking to the Conversation Cleanup Feature

主宰稳场 提交于 2019-12-12 14:43:25
问题 Outlook 2010 has a feature called Convesation Cleanup . This feature is implemented using the Conversation Header Outlook Object Model. I would like to hook to this call and perform an action when triggered, yet I can't figure out how to catch it/hook on to it. Is anyone aware if this is possible? If its not, are you aware of any way around it? I have tried using outlook spy to view the event log when executing 'conversation cleanup' with no luck (nothing logged)... is there anyway of viewing

Change Outlook settings using VSTO

混江龙づ霸主 提交于 2019-12-10 17:47:04
问题 I have just spent about 4 hours trying to figure out how to retrieve/set outlook settings for Microsoft Outlook 2010 programmatically. What i mean by 'settings' is settings under the File/Options/Mail. What i am trying to do is to retrieve a list of settings set by the user, automate a whole print process that we need to run daily on some messages and then restore the settings. to their original. I have noticed that in Word the code below can be used to set certain settings through Word

How do I get the selected text from a WordEditor Object and change it's color?

别来无恙 提交于 2019-12-10 10:54:03
问题 I'm trying to use the WordEditor object to modify the color of the selected text (Outlook VBA) but i'm unable to find documentation or examples on how to do it. Any ideas? I don't want to use the HTML editor, i need a solution for WordEditor . I tried debuging the code and using OutlookSpy, but everytime i go into WordEditor.Content my outlook freezes and restarts :(. Using Outlook 2010 on Windows 7 回答1: OK - I found something that works. Ugly, but works: Sub EmphesizeSelectedText(color As