Propriedade XmlMappedRange.XPath

Obtém Microsoft.Office.Interop.Excel.XPath que representa o XPath do elemento mapeado para o controle de XmlMappedRange .

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

Sintaxe

'Declaração
ReadOnly Property XPath As XPath
XPath XPath { get; }

Valor de propriedade

Tipo: Microsoft.Office.Interop.Excel.XPath
Microsoft.Office.Interop.Excel.XPath que representa o XPath do elemento mapeado para o controle de XmlMappedRange .

Exemplos

O exemplo de código a seguir usa a propriedade de XPath para remover o XPath de XmlMappedRange se o que é “/ns1: Customer/ns1: Sobrenome”.O exemplo exibe no XPath atual de XmlMappedRange.Este exemplo de código a seguir pressupõe que a planilha atual contiver XmlMappedRange chamado 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);
    }
}

Segurança do .NET Framework

Consulte também

Referência

XmlMappedRange Interface

Namespace Microsoft.Office.Tools.Excel