Właściwość XmlMappedRange.XPath —

Pobiera Microsoft.Office.Interop.Excel.XPath reprezentująca XPath mapowane do elementu XmlMappedRange kontroli.

Przestrzeń nazw:  Microsoft.Office.Tools.Excel
Zestaw:  Microsoft.Office.Tools.Excel (w Microsoft.Office.Tools.Excel.dll)

Składnia

'Deklaracja
ReadOnly Property XPath As XPath
XPath XPath { get; }

Wartość właściwości

Typ: Microsoft.Office.Interop.Excel.XPath
Microsoft.Office.Interop.Excel.XPath Reprezentująca XPath mapowane do elementu XmlMappedRange kontroli.

Przykłady

Następujący kod w przykładzie wykorzystano XPath właściwość, aby usunąć XPath XmlMappedRange Jeśli wyrażenie XPath jest "/ ns1:Customer / ns1:LastName".Następnie w przykładzie zostanie wyświetlony bieżący XPath XmlMappedRange.W tym przykładzie kodu zakłada, że bieżący arkusz zawiera XmlMappedRange o nazwie CustomerLastNameCell.

Private Sub RemoveXPath()
    If Me.CustomerLastNameCell.XPath.Value = _
        "/ns1:Customer/ns1:LastName" Then
        Me.CustomerLastNameCell.XPath.Clear()
        MsgBox("Removed matching XPath.")
    End If

    If Me.CustomerLastNameCell.XPath.Value = Nothing Then
        MsgBox("The XmlMappedRange has no XPath.")
    Else
        MsgBox("The XPath of the XmlMappedRange is " & _
            Me.CustomerLastNameCell.XPath.Value)
    End If
End Sub
private void DisplayXPath()
{
    if (this.CustomerLastNameCell.XPath.Value ==
        "/ns1:Customer/ns1:LastName")
    {
        this.CustomerLastNameCell.XPath.Clear();
        MessageBox.Show("Removed mathing XPath.");
    }

    if (this.CustomerLastNameCell.XPath.Value == null)
    {
        MessageBox.Show("The XmlMappedRange has no XPath.");
    }
    else
    {
        MessageBox.Show("The XPath of the XmlMappedRange is " +
            this.CustomerLastNameCell.XPath.Value);
    }
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

XmlMappedRange Interfejs

Przestrzeń nazw Microsoft.Office.Tools.Excel