共用方式為


XMLNode.XML Property

Definition

Gets a string that represents the XML text in the XMLNode control.

public:
 property Microsoft::Office::Tools::Word::XMLNode_XMLType ^ XML { Microsoft::Office::Tools::Word::XMLNode_XMLType ^ get(); };
public Microsoft.Office.Tools.Word.XMLNode_XMLType XML { get; }
member this.XML : Microsoft.Office.Tools.Word.XMLNode_XMLType
Public ReadOnly Property XML As XMLNode_XMLType

Property Value

A string that represents the XML text in the XMLNode control.

Examples

The following code example uses the XML property to display the XML contents of an XMLNode with and without the Word XML markup. This example assumes that the current document contains an XMLNode named CustomerNode.

private void DisplayXML()
{
    MessageBox.Show("The XML of '" + this.CustomerNode.BaseName +
        "' without the Word markup: " + this.CustomerNode.XML[true]);

    MessageBox.Show("The XML of '" + this.CustomerNode.BaseName +
        "' with the Word markup: " + this.CustomerNode.XML[false]);
}
Private Sub DisplayXML()
    MsgBox("The XML of '" & Me.CustomerNode.BaseName & _
        "' without the Word markup: " & Me.CustomerNode.XML(True))

    MsgBox("The XML of '" & Me.CustomerNode.BaseName & _
        "' with the Word markup: " & Me.CustomerNode.XML(False))
End Sub

Remarks

The XML property is intended to be used with the following parameter.

Parameter Description
ListTemplate true to return the text of the XML without the Word XML markup; otherwise, false. The default is false.

If you use the XML property without specifying a parameter, it returns an XMLNode_XMLType object that is not intended to be used directly from your code.

Optional Parameters

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

Applies to