none
Display Form Region based on MessageClass RRS feed

  • Question

  • I am trying to display a separate form region when an existing appointment is selected in the calendar (double-clicked). 

    The appointment is created using the same form region. I set the MessageClass of the appointment item to the custom class. I also set the FormRegionMessageClass attribute to the same name on the region's factory. 

    [Microsoft.Office.Tools.Outlook.FormRegionMessageClass(Microsoft.Office.Tools.Outlook.FormRegionMessageClassAttribute.Appointment)]
            [Microsoft.Office.Tools.Outlook.FormRegionMessageClass("IPM.Appointment.Company.Provider")]
            [Microsoft.Office.Tools.Outlook.FormRegionName("Conpany.FormRegion1")]
            public partial class FormRegion1Factory
            {
                // Occurs before the form region is initialized.
                // To prevent the form region from appearing, set e.Cancel to true.
                // Use e.OutlookItem to get a reference to the current Outlook item.
                private void FormRegion1Factory_FormRegionInitializing(object sender, Microsoft.Office.Tools.Outlook.FormRegionInitializingEventArgs e)
                {
    
                }
            }
    

    If I understand the documentation correctly this is how you do it, but it does not work. I also haven't been able to find anyway to get to the inspector to hide the default appointment form and set the current form page to the region. The region is created and is available on the ribbon and displays when clicked but the default is always shown.

    Is it possible to bind a messageclass to a form region such that the region is displayed by default?



    Tuesday, July 31, 2018 4:55 PM

Answers

  • Terry:

    It is a form region that replaces the default appointment form page. The IPM.Appointment.Company.Provider is custom message class that is assigned to each appointment created using the new form region. I want the inspector to open to the new form region instead of the default appointment form when double clicking on a calendar view.

    I appreciate your reply. I went back, checked the code and found the issue, I had not set FormRegionType to replacement, but instead left as separate. Once I changed this it worked as expected.

    Thanks.

    Richard


    • Edited by PBCorp Thursday, August 2, 2018 2:10 PM
    • Proposed as answer by Terry Xu - MSFT Friday, August 3, 2018 1:03 AM
    • Marked as answer by PBCorp Friday, August 3, 2018 11:14 AM
    Thursday, August 2, 2018 2:07 PM

All replies

  • Hello PBCorp,

    What's the IPM.Appointment.Company.Provider? It should be a custom form , right? If so, why not design on the custom form directly?

    Besides, since it is a custom form, what about creating an replacement form region to replace the default page of the form?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 2, 2018 10:01 AM
  • Terry:

    It is a form region that replaces the default appointment form page. The IPM.Appointment.Company.Provider is custom message class that is assigned to each appointment created using the new form region. I want the inspector to open to the new form region instead of the default appointment form when double clicking on a calendar view.

    I appreciate your reply. I went back, checked the code and found the issue, I had not set FormRegionType to replacement, but instead left as separate. Once I changed this it worked as expected.

    Thanks.

    Richard


    • Edited by PBCorp Thursday, August 2, 2018 2:10 PM
    • Proposed as answer by Terry Xu - MSFT Friday, August 3, 2018 1:03 AM
    • Marked as answer by PBCorp Friday, August 3, 2018 11:14 AM
    Thursday, August 2, 2018 2:07 PM
  • Hello PBCorp,

    Glad to hear that your issue has been resolved. I would suggest you mark your solution which is the correct way to close a thread.

    If you have any other issues, please feel free to post threads to let us know.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 3, 2018 1:05 AM