Export (0) Print
Expand All
Expand Minimize

NamedRange.PrefixCharacter Property

Gets the prefix character for the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object PrefixCharacter { get; }

Property Value

Type: System.Object
The prefix character for the NamedRange control.

If the value of the TransitionNavigKeys property is false, this prefix character is ' for a text label, or blank. If the value of the TransitionNavigKeys property is true, this character is ' for a left-justified label, " for a right-justified label, ^ for a centered label, \ for a repeated label, or blank.

The following code example uses the PrefixCharacter property to display the prefix character for a NamedRange.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange prefixRange;
private void DisplayPrefixCharacter()
{
    prefixRange = this.Controls.AddNamedRange(
         this.Range["C1"], "prefixRange");
    if ((string)this.prefixRange.PrefixCharacter == "")
    {
        MessageBox.Show("The prefix character is blank.");
    }
    else
    {
        MessageBox.Show("The prefix character is: " +
            this.prefixRange.PrefixCharacter);
    }
}

Show:
© 2014 Microsoft