How to change the Title of a form region at runtime?

M

Mark B

OL2007, VSTO C#.

Does anyone know how to change the Title of a form region at runtime?
 
K

Ken Slovak - [MVP - Outlook]

I don't believe you can, other than changing the XML before it's supplied to
the handler.
 
M

Mark B

The following works until I modify the design of the region in the Designer
at which point the designer naturally overwrites my code. No doubt that's
why it says "Required method for Designer support - do not modify ".

I wonder if anyone has any examples then of how I would modify the XML file
directly. I would need to put the result of a method call to get the dynamic
text, that is, in this case, FText.GetText(1298).


#region Form Region Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private static void
InitializeManifest(Microsoft.Office.Tools.Outlook.FormRegionManifest
manifest)
{
manifest.FormRegionType =
Microsoft.Office.Tools.Outlook.FormRegionType.Adjoining;
manifest.ShowInspectorCompose = false;
manifest.ShowInspectorRead = false;
manifest.Title = "My Static Title";
manifest.Title = FText.GetText(1298);
}
#endregion
 
K

Ken Slovak - [MVP - Outlook]

You would have to not use the VSTO designer and code everything yourself.
But even there you have to get whatever text you want and supply it once,
and you'd have to create the XML you supply on the fly or modify it on the
fly to do that before supplying it. Once you supplied the XML you couldn't
change it again for that form region.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top