How to Expand OutlookFormRegion in C#?

asked 2022-12-22T13:13:30.493+00:00
Jhan Zaib 1 Reputation point

I am facing am issue in Outlook VSTO addIn where OutlookFormRegion is used in Adjoining FormRegionType. So is there a way to change its state i.e. expand (if region is collapsed) via C#?

I could not find a location where this state persists? In my opinion, we can change this by accessing this?

I have tried this solution but this did not work for me.

Also share your thoughts if we can disable this expand/collapse option?

Any idea?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
1,935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2023-01-01T00:57:11.307+00:00
    TechLife 241 Reputation points

    You can use the FormRegion.IsExpanded property to check if the form region is currently expanded or collapsed. To expand or collapse the form region, you can use the FormRegion.Expanded property. Here's an example of how you can use these properties to expand the form region if it is currently collapsed:

    Outlook.FormRegion formRegion = // get a reference to the form region  
    if (!formRegion.IsExpanded)  
        formRegion.Expanded = true;  

    Note that this will only work if the form region is of type AdjoiningFormRegion, which supports expanding and collapsing. If the form region is of a different type, this property will not be available.