none
Creating Outlook custom form field that allows formatted text RRS feed

  • Question

  • I am extending the Task item and want to include some Comment fields as well as a field for users to be able to enter a link to a folder or URL.  I would like the Comments fields to all bullet points and font color changes.  I have created a Text Box field but can't figure out how to make it be such that the info entered into the text box once I publish the form is format-able.

    Any guidance would be appreciated.

    Thanks!

    Thursday, January 15, 2015 3:07 PM

Answers

  • The built-in Notes (message body) field is the only field that can "light up" formatting features.  Otherwise you are stuck with simple, plain text controls.

    I would recommend creating a Form Region or Task Pane in a .NET add-in so that you can use Windows Form controls that can provide richer functionality.


    Eric Legault (MVP: Outlook)
    Co-author, Microsoft Office 2013 Professional Step-By-Step
    Try Outlook Touch!

    Thursday, January 15, 2015 3:49 PM
    Moderator
  • I am very surprised that my previous message above is deleted...

    Anyway, the Creating Outlook Form Regions section in MSDN contains all the required information you need to know about Outlook Form Regions when developing add-ins.

    > And how does that expose Windows Form controls?

    VSTO provides templates for adding Outlook form regions items to the project. They look like a regular windows form control (or user controls). So, you can simply drag and drop the required Windows Forms control onto the surface of your form.

    > Will I then be able to use those controls to tie to custom fields in my Outlook form?

    Yes, you will. But you will have to do some extra work in case of add-ins. The fields will not be binded automatically, you will have to read and set values programmatically in the code. You can use the PropertyAccessor object for reading and writing custom properties.

    > Also, if I want to prompt the user to navigate to, say, a .PDF on their C:-drive and then capture the path and file name to utilize programatically, is that possible?

    Yes, it is. You may treat a .Net based add-in as a regular .Net application. There is no difference between them from the high perspective. You are free to use all BCL classes from .Net framework.


    Thursday, January 15, 2015 5:28 PM

All replies

  • The built-in Notes (message body) field is the only field that can "light up" formatting features.  Otherwise you are stuck with simple, plain text controls.

    I would recommend creating a Form Region or Task Pane in a .NET add-in so that you can use Windows Form controls that can provide richer functionality.


    Eric Legault (MVP: Outlook)
    Co-author, Microsoft Office 2013 Professional Step-By-Step
    Try Outlook Touch!

    Thursday, January 15, 2015 3:49 PM
    Moderator
  • Thanks for the reply Eric.  I am new to Outook cutom forms and relatively new to object-based programming (but have a long programming history with older programming languages).  So pardon the question if it is a basic one, but I see how to create a Form Region and a Task Pane in my custom Outlook form but when you say "...in a .NET add-in...", what exactly does that mean?  And how does that expose Windows Form controls?  Will I then be able to use those controls to tie to custom fields in my Outlook form?

    Also, if I want to prompt the user to navigate to, say, a .PDF on their C:-drive and then capture the path and file name to utilize programatically, is that possible?  I found some info on how to use a form label to act as a hyperlink so I want to be able to prompt a user for a path and file name and then store what they provide as the hyperlink address.


    Thursday, January 15, 2015 4:45 PM
  • Customizing Outlook forms the way you are doing has long gone "out of style".  You can create Form Regions with the designer built-into Outlook, but you are still very limited to what you can do.  You require deeper customizations that are only possible with a COM Add-in.  To build an add-in, you need to use Visual Studio and the .NET framework.  This is the best place to start:

    Create Add-ins and Customizations for Office by using Visual Studio:
    http://msdn.microsoft.com/en-us/library/jj620922.aspx

    Let me know if you need any more guidance.


    Eric Legault (MVP: Outlook)
    Co-author, Microsoft Office 2013 Professional Step-By-Step
    Try Outlook Touch!

    Thursday, January 15, 2015 4:57 PM
    Moderator
  • I am very surprised that my previous message above is deleted...

    Anyway, the Creating Outlook Form Regions section in MSDN contains all the required information you need to know about Outlook Form Regions when developing add-ins.

    > And how does that expose Windows Form controls?

    VSTO provides templates for adding Outlook form regions items to the project. They look like a regular windows form control (or user controls). So, you can simply drag and drop the required Windows Forms control onto the surface of your form.

    > Will I then be able to use those controls to tie to custom fields in my Outlook form?

    Yes, you will. But you will have to do some extra work in case of add-ins. The fields will not be binded automatically, you will have to read and set values programmatically in the code. You can use the PropertyAccessor object for reading and writing custom properties.

    > Also, if I want to prompt the user to navigate to, say, a .PDF on their C:-drive and then capture the path and file name to utilize programatically, is that possible?

    Yes, it is. You may treat a .Net based add-in as a regular .Net application. There is no difference between them from the high perspective. You are free to use all BCL classes from .Net framework.


    Thursday, January 15, 2015 5:28 PM
  • Great.  I appreciate your help.
    Thursday, January 15, 2015 8:30 PM