outlook-object-model

Using MAPI to access the Exchange Server from a Service

前提是你 提交于 2019-12-08 06:03:55
问题 I was tasked with building an application that would check email using MAPI. I made use of a wrapper class coded in cpp, which is accessed from c#. I realize that combining managed and unmanaged code is not necessarily the best path, but it was what I could get to work. After getting it working, I was asked to make the application a service, so it could be run when the system was not logged in. The client requires us to use MAPI, and is using Outlook 2007, but I would like it to be compatible

Create IMAP account in Outlook 2007 programmatically

て烟熏妆下的殇ゞ 提交于 2019-12-08 02:13:49
问题 we're rolling out a new voicemail system, and trying to figure out a way to programmatically add a new IMAP account to a user's Outlook. Idea is that I create a form that takes a bunch of fields needed, and creates it all for them. 回答1: I would take a look at Redemption In the commercial version there is a bonus dll "profman" Which allows you play with the outlook profiles. 来源: https://stackoverflow.com/questions/2589838/create-imap-account-in-outlook-2007-programmatically

Get Inboxes from Outlook

不打扰是莪最后的温柔 提交于 2019-12-07 05:54:17
问题 I configured two Exchange accounts in Outlook 2010, however I cant find out how to get to Inbox of the second account. Session.GetDefaultFolder() always return the first one. Even enumerating Session.Accounts, finding the right account and calling Session.Account(found one).Store.GetDefaultFolder() returns wrong Inbox (from the default exchange account, not the secondary). 回答1: Does this show you all the available Inboxes? Sub LoopThroughInboxes Dim ol As Outlook.Application Dim ns As Outlook

How to connect to outlook 2010 while its running in c#?

无人久伴 提交于 2019-12-06 19:05:02
问题 What I am trying to do is add an "Email To..." button to a winform client that opens a new outlook mail window and attaches a file so the user can forward it. I can get the outlook integration working just fine if outlook is not already running. This is a C# .NET 4.0 winforms app, using the Outlook 14.0 interop library, against Outlook 2010 32 bit running on windows 7 64 bit machine. I have the app already compiled to x86 for other reasons so I doubt its a 32/64 bit issue. Here is my code: //

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

蓝咒 提交于 2019-12-06 16:34:04
[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 created-on-the-fly proxy object rather than the inspector instance itself. Try it: Accessing the same

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

落爺英雄遲暮 提交于 2019-12-06 12:55:26
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 OK - I found something that works. Ugly, but works: Sub EmphesizeSelectedText(color As Long) Dim msg As Outlook.MailItem Dim insp As Outlook.Inspector Set insp = Application.ActiveInspector If insp

Create IMAP account in Outlook 2007 programmatically

大憨熊 提交于 2019-12-06 11:31:10
we're rolling out a new voicemail system, and trying to figure out a way to programmatically add a new IMAP account to a user's Outlook. Idea is that I create a form that takes a bunch of fields needed, and creates it all for them. I would take a look at Redemption In the commercial version there is a bonus dll "profman" Which allows you play with the outlook profiles. 来源: https://stackoverflow.com/questions/2589838/create-imap-account-in-outlook-2007-programmatically

Dynamically load and use COM object in C#

只谈情不闲聊 提交于 2019-12-06 05:27:35
问题 I have a C# project, where I would like to access MS outlook, if it is installed on a client´s machine. The "access outlook" part has been done by referencing the outlook COM object, and going from there. My problem is now the "if it is installed" part. At the moment, my project doesn´t compile on machines without outlook installed, so I assume that I will have to not reference the outlook component, and instead load and use it dynamically, after detecting that outlook is present, but I haven

Get Inboxes from Outlook

只谈情不闲聊 提交于 2019-12-05 10:29:03
I configured two Exchange accounts in Outlook 2010, however I cant find out how to get to Inbox of the second account. Session.GetDefaultFolder() always return the first one. Even enumerating Session.Accounts, finding the right account and calling Session.Account(found one).Store.GetDefaultFolder() returns wrong Inbox (from the default exchange account, not the secondary). Does this show you all the available Inboxes? Sub LoopThroughInboxes Dim ol As Outlook.Application Dim ns As Outlook.NameSpace Dim i As Long Set ol = Outlook.Application Set ns = ol.GetNamespace("MAPI") For i = 1 To ns

How to connect to outlook 2010 while its running in c#?

无人久伴 提交于 2019-12-05 01:39:29
What I am trying to do is add an "Email To..." button to a winform client that opens a new outlook mail window and attaches a file so the user can forward it. I can get the outlook integration working just fine if outlook is not already running. This is a C# .NET 4.0 winforms app, using the Outlook 14.0 interop library, against Outlook 2010 32 bit running on windows 7 64 bit machine. I have the app already compiled to x86 for other reasons so I doubt its a 32/64 bit issue. Here is my code: // Connect to outlook and create a new mail item var app = new Outlook.Application(); var ns = app