Develop an Outlook custom plug-in

Source: Internet
Author: User

Develop an Outlook custom plug-in

I want to write a blog for a long time, but I have not been able to take the first step. Today, I have finally prepared my blog path. I hope I can share with you the difficulties and responsibilities I have encountered in my work in the future.

This blog mainly records how I developed an Outlook plug-in. My personal blog was just started and may not be well described in many places. Thank you for your understanding.

I don't need to talk about it anymore. The Outlook plug-in mainly provides custom email functions, such as timed archiving and address book setting. Now we are developing a simple plug-in application.

First, you must first install the programming environment. Here is the link:

Install VS2013 or VS2015 programming software.

Install VS2013 tutorial link: http://jingyan.baidu.com/article/92255446880460851648f429.html

Install VS2015 tutorial link: http://jingyan.baidu.com/article/642c9d34fc5fa0644b46f74a.html

 

The following are the development steps:

 

1. Create a WinFrom Application Project

 

Sept1: Open VS2013

      

 

Sept2: Click file in the menu bar, click New, and click Project]

 

      

 

Sept3: In the displayed dialog box, select installed, select template, select Visual C #, select Windows, and select Windows form application ], enter the project name and click OK. Then, a Windows application is created.

 

      

 

The project code structure in Solution Explorer on the right is as follows:

 

      

 

2. Create an Outlook plug-in Project

 

Sept1: In Solution Explorer on the right of the created Windows Forms Application, right-click solution "Outlook "and choose add ], select New Project]

 

      

 

Sept2: In the displayed dialog box, select "installed", select "Visual C #", select "Office/SharePoint", and select "Office external program ], select Outlook 2013 external program, enter the project name, and click OK. Then we have created an Outlook external program.

 

      

 

The project code structure in Solution Explorer on the right is as follows:

 

      

 

3. Create references and develop an example

 

Sept1: Create a plug-in and application reference. In Solution Explorer on the right, select OutlookAddIn1, right-click reference, and select Add reference]

 

      

 

Sept2: In the pop-up dialog box, select solution, select project, select Outlook external program, and click OK to reference the plug-in to the application.

 

      

 

In this case, you can see that the OutlookAddIn1 project references the [Outlook external endpoint], such:

 

      

 

Sept3: Add a functional area XML for the OutlookAddIn1 project, right-click the OutlookAddIn1 project in Solution Explorer, select add, and select new item]

 

      

 

Sept4: In the displayed dialog box, select "installed", select "Visual C # items", select "Office/SharePoint", select "functional area (XML)", and enter a name, click Add.

 

      

 

After adding the functional area file, the project code structure is as follows:

 

      

 

Sept4: design the functional area, add a button to open the Ribbon1.xml file, type the following content in the file, and then save,

 

      

 

 

      

 

Open the ThisAddIn. cs file and add the plug-in entry code,

 

      

 

Right-click OutlookAddIn1, select set as startup project, and press F5 for debugging. in Outlook, the UI indicates that the UI of the functional area has been added successfully,

 

      

 

Sept5: Below we load an image on the button to make the interface more friendly. First, add an image to the resource file.

 

      

 

Copy the file, double-click the file Resources. resx, and press Ctrl + V to add the file to the resource file:

 

      

 

Open Ribbon1.xml, configure the image loading method, and click the image,

 

      

 

Open the [Ribbon1.cs] file to go to the image loading method, and add [using System. Drawing;] reference,

 

      

 

Then press F5 for debugging. in Outlook, the UI indicates that the UI icon of the functional area has been added successfully,

 

      

 

Sept6: Add a click event for the button, open the Ribbon1.xml file, and enter the content as the button to add a click event

 

      

 

Open the Ribbon1.cs file, add and click the Event code, and enter the following content:

 

      

 

Then press F5 for debugging, and click test button in Outlook. The interface shows that the event has been successfully added when the function area button is clicked,

 

      

 

Sept7: Call [Outlook ins] On the ins to call the ins. Open the Form1.cs file in the [Outlook ins] project and type the following content

 

      

 

Open the Ribbon1.cs file, change the Event code, and enter the content.

 

      

 

Then press F5 for debugging. in Outlook, click test button. The interface indicates that the functional area button is displayed. Click the event to call the application.

 

      

 

At this point, we have developed a plug-in application. The next blog will focus on how to package it into an installation package for installation by others. Thank you for your consideration.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.