简体   繁体   中英

Creating a settings page for a VSTO custom ribbon add-in

I'm making a custom add-in for Outlook 2013/2016 and decided to implement it with a custom ribbon button. I've followed this guide which has been good so far : https://timdams.com/2017/05/09/how-to-create-a-simple-outlook-vsto-addin-a-step-by-step-guide/

The add-in simply edits the "location" field of a new meeting request or appointment and inserts a pre-defined phone number (for a conference call etc).

I've got that part working with the click of a custom button in the ribbon, but the inserted phone number is hard coded. I'd like to make it customizable and create another button that brings up a "settings page" where a user can enter in their own phone number, save it, and then the add-in will use that number instead.

I'm having trouble finding resources on how to do this. If someone could point me in the right direction that would be great.

You can create a regular Winform. The only trick is to make sure it is parented correctly to the right Outlook Inspector or Explorer object - cast the appropriate object to IOleWindow , then call IOleWindow.GetWindow . Once you have HWND , you can use it with the NativeWindow object and pass it to Form.ShowDialog() .

I'd suggest creating an adjoining Outlook form region for such purposes. So, users could easily edit the settings for new meeting requests or appointments. See Create Outlook form regions for more information. Also, you may find the Walkthrough: Design an Outlook form region article helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM