Question Process VS Program -- which is best for this task?

complete

Active member
Joined
Oct 24, 2012
Messages
25
Programming Experience
3-5
I am looking to start a new project and I am wondering if it can be some sort of C# program or if it has to be something else. I want the program to be kicked off when Outlook receives a new email. Can it be a program or does it have to be some sort of process. Please advise.
 
If you want to do something when something happens in Outlook, I would think that something in Outlook would be required. Whether or not that could just be a macro or would need to be something more elaborate, I'm not sure, as I'm not much of an Office developer, although I suspect the latter. Whether or not the bulk of the processing was done there or that just kicked off a separate program to do the main work is also another matter. I think you probably need to provide more specific details to get a more thorough answer.
 
Yes, you can use C# to develop plugins for Outlook and no, it doesn't have to be a separately running program
 
At the moment, I am thinking about having a separately running application without a UI just grabbing email messages when they come. This, I think, will be a shorter development cycle than learning how to interface with Microsoft Outlook.

My question now is this. If my program "intercepts" an email message, will it still be received by Outlook?
 
Depends how you "intercept" the email.

If Outlook is configured to talk to a POP or IMAP server; and your standalone program is going to pretend it is an POP or IMAP server; and Outlook is re-configured to get mail from your standalone app, then it will all depend on what you allow to be visible to Outlook.

If on the other hand, you have your standalone program also be a POP or IMAP client just like Outlook is also a client, then it's depends on whether you are using POP or IMAP. If POP, and you happen to get the message from the POP server first, you can tell the POP server to delete the message. If you get it after Outlook, then it's too late Outlook already has it. If IMAP, then you can tell the IMAP server to delete the message, and it will (eventually) be deleted from Outlook. The only real race condition will be if the user is an old school Outlook user who double clicks on messages (like me) to open the message in a new window. Then no amount of deleting will cause the currently open window to close.

It's also similar to IMAP if Outlook is configured to talk to an Exchange server, but your degree of difficulty goes up dramatically since learning to use MAPI (Mail API) is dying art. It was already obscure enough when MAPI was first created, and it's getting to be a rarer and rarer skill nowadays. I am also guessing that it will also be difficult to write a standalone app that acts like an Exchange server.
 
But ChatGPT will just essentially copy other existing Outlook plugin code that fires on the new mail received event. If you are lucky it will be code that doesn't result in zombie Outlook processes left behind. Where is the fun in that? :)
 
Back
Top Bottom