XMLNode.Range Property

Gets a Range object that represents the portion of a document that is contained in the XMLNode control.

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

Syntax

'Declaration
ReadOnly Property Range As Range
Range Range { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Range
A Range object that represents the portion of a document that is contained in the XMLNode control.

Examples

The following code example uses the Range property to set the font and apply bold formatting to the text in an XMLNode. This example assumes that the current document contains an XMLNode named CustomerLastNameNode.

Private Sub FormatNodeText()
    Me.CustomerLastNameNode.NodeText = "Smith" 
    Me.CustomerLastNameNode.Range.Bold = 1
    Me.CustomerLastNameNode.Range.Font.Name = "Arial" 
End Sub
private void FormatNodeText()
{
    this.CustomerLastNameNode.NodeText = "Smith";
    this.CustomerLastNameNode.Range.Bold = 1;
    this.CustomerLastNameNode.Range.Font.Name = "Arial";
}

.NET Framework Security

See Also

Reference

XMLNode Interface

Microsoft.Office.Tools.Word Namespace