none
Is it possible to make required fields in Outlook email templates? RRS feed

  • Question

  • Hi everyone,

    I would like to make Outlook email templates that contain required fields, so that sending the email is not possible while at least one of those fields is left blank.
    Is this possible? If so, how can I achieve this? If not, what would be the best alternative?

    Thank you,
    Cooz

    Monday, August 11, 2014 9:34 AM

Answers

  • Hello Cooz,

    Yes, this is possible. However, it is not clear what required fields you are talking about - is it a built-in inspector fields such To, CC, BCC, Body and etc. or your own form?

    Anyway, the ItemSend event of the Application class is fired when the inspector window is already closed. So, it will not help in that case. You may find the event helpful only for making any decisions when the message is submitted for sending (is going out of your mailbox).

    Instead, you may check all fields values when the user clicks the send button in the UI. The Fluent UI allows to repurpose controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information. For example, when a user click the Send button you can check out the required fields and make a decision whether to cancel the action or not (show a message that required fields don't have values set). Be aware, the user can send items from an explorer window without opening an inspector window or programmatically. In that case the ItemSend event will be fired.

    Also you may find the Close event of the Inspector class helpful. It is fired when the inspector associated with a Microsoft Outlook item is being closed.
    Monday, August 11, 2014 12:41 PM

All replies

  • Hi Cooz,

    Do you mean creating a custom Outlook Form (based on Email) with some new fields you'd like to add?
    In this case, you can use the Item_Send Event in the code of the custom form, to check if the required fields are empty or not, and to cancel the send operation (with appropriate message to the user) if the fields are empty.

    Moshe

    Monday, August 11, 2014 10:11 AM
  • Hello Cooz,

    Yes, this is possible. However, it is not clear what required fields you are talking about - is it a built-in inspector fields such To, CC, BCC, Body and etc. or your own form?

    Anyway, the ItemSend event of the Application class is fired when the inspector window is already closed. So, it will not help in that case. You may find the event helpful only for making any decisions when the message is submitted for sending (is going out of your mailbox).

    Instead, you may check all fields values when the user clicks the send button in the UI. The Fluent UI allows to repurpose controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information. For example, when a user click the Send button you can check out the required fields and make a decision whether to cancel the action or not (show a message that required fields don't have values set). Be aware, the user can send items from an explorer window without opening an inspector window or programmatically. In that case the ItemSend event will be fired.

    Also you may find the Close event of the Inspector class helpful. It is fired when the inspector associated with a Microsoft Outlook item is being closed.
    Monday, August 11, 2014 12:41 PM
  • Hi Moshe,

    I will look into this. Thank you for your suggestion.

    Cooz

    Monday, August 18, 2014 7:04 AM
  • Hi Eugene,

    This sounds good. Thank you. I'll dig a little further into what you suggested.

    Cooz
    Monday, August 18, 2014 7:07 AM