Właściwość XmlMappedRange.XPath —
Pobiera Microsoft.Office.Interop.Excel.XPath , oznaczającą 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 , Oznaczającą XPath mapowane do elementu XmlMappedRange kontroli.
Przykłady
Następujący kod w przykładzie wykorzystano XPath właściwość, aby usunąć ścieżki XPath do XmlMappedRange Jeśli wyrażenie XPath jest "/ ns1:Customer / ns1:LastName".W przykładzie następnie wyowietlane bieżące wyrażenie XPath z XmlMappedRange.W tym przykładzie kodu zakłada, że zawiera bieżący arkusz 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
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Przy użyciu bibliotek z częściowo zaufanego kodu..