Share via


XmlMappedRange.Characters Property

Definition

Gets a Characters object that represents a range of characters within the text of the XmlMappedRange control.

public:
 property Microsoft::Office::Tools::Excel::XmlMappedRange_CharactersType ^ Characters { Microsoft::Office::Tools::Excel::XmlMappedRange_CharactersType ^ get(); };
public Microsoft.Office.Tools.Excel.XmlMappedRange_CharactersType Characters { get; }
member this.Characters : Microsoft.Office.Tools.Excel.XmlMappedRange_CharactersType
Public ReadOnly Property Characters As XmlMappedRange_CharactersType

Property Value

A Characters object that represents a range of characters within the text of the XmlMappedRange control.

Examples

The following code example uses the Characters property to apply bold formatting to the first character in the text of an XmlMappedRange. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

private void FormatCharacters()
{
    this.CustomerLastNameCell.Characters[1, 1].Text = "Smith";
    this.CustomerLastNameCell.Characters[1, 1].Font.Bold = true;
}
Private Sub FormatCharacters()
    Me.CustomerLastNameCell.Characters(1, 1).Text = "Smith"
    Me.CustomerLastNameCell.Characters(1, 1).Font.Bold = True
End Sub

Remarks

The Characters property is intended to be used with the following parameters.

Parameter Description
Start The first character to be returned. If this argument is either 1 or omitted, this property returns a range of characters starting with the first character.
Length The number of characters to be returned. If this argument is omitted, this property returns the remainder of the string (everything after the Start character).

If you attempt to use Characters without specifying any parameters, Characters will get an XmlMappedRange_CharactersType object that is part of Office development tools in Visual Studio infrastructure and is not intended to be used directly from your code.

You can use the Microsoft.Office.Interop.Excel.Characters object to format characters within a text string.

The Microsoft.Office.Interop.Excel.Characters object is not a collection.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to