Create Outlook Add-in by MAPI Functionality by Using Visual Studio 2010 Outlook Project

Create Outlook project in Visual Studio 2010. Create Outlook Add-in by using Messaging Application Programming Interface (MAPI). This add-in does the following:

  • Get every new email.

  • Process every new email

  • Get details of received email

  • Save attachment of that email

  • Mark that email with read flag

  • Move that email to outlook other folder

  • Determine unread email and process on that email

Messaging Application Programming Interface (MAPI)

MAPI is a messaging architecture and a Component Object Model based API for Microsoft Windows. MAPI allows client programs to become (e-mail) messaging-enabled, -aware, or -based by calling MAPI subsystem routines that interface with certain messaging servers. While MAPI is designed to be independent of the protocol, it is usually used with MAPI/RPC, the proprietary protocol that Microsoft Outlook uses to communicate with Microsoft Exchange

The following link refers to creation of an Outlook Express add-in:

http://msdn.microsoft.com/en-us/library/vstudio/cc668191.aspx

Using Visual Studio 2010, creates an Outlook Project for outlook add-in by using MAPI functionality. Use the following procedure to do that.

1 Create Outlook Project

 Image1.jpg

2. Initial look of the new project:

 Image2.jpg

3. Default generated code:

 Image3.png

4. Default code:

Image4.png

5. Handle new email receive event:

 Image5.jpg

6. Application_NewMailEx is a customer function.

EntryIDCollection is a unique id of received email in outlook.

 Image6.jpg

7. Move Email to custom folder of outlook:

 Image7.jpg

8. Search unread email in inbox:

 Image8.jpg

9. Property created:

 Image8.5.png

Now the code is done; now to publish this project and set up this add-in Outlook.

1. Publish Code:

 Image9.jpg

2. Default Path:

 Image10.png

3. Storage media:

 Image11.png

4. Published file path:

 Image12.png

5. Published file and folder:

 Image13.png

Now set up add-in in outlook for use.

1. Run Setup file:

Image14.png  

2. Install Add-in:

 Image15.png

3. Successful installed:

 Image16.png

Note: After successfully installed, restart Outlook.

4. See installed Add-in Add-Remove program:

 Image17.png

5. See in Outlook add-in list:

Outlook file menu --> Option

 Image18.png

6. Add-ins:

 Image19.png

7. Add-in list:

 Image20.jpg

Now your add-in is ready for email processing.

This is basic functionality, you can add your own functionality.

Here I attached a complete functional solution of Visual Studio 2010.

If you have any query then please let me know.
 

Next Recommended Readings