XmlMappedRange.XPath Property (2007 System)
Gets an XPath that represents the XPath of the element mapped to the XmlMappedRange control.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property XPath As XPath
'Usage
Dim instance As XmlMappedRange
Dim value As XPath
value = instance.XPath
[BrowsableAttribute(false)]
public XPath XPath { get; }
[BrowsableAttribute(false)]
public:
property XPath^ XPath {
XPath^ get ();
}
public function get XPath () : XPath
Property Value
Type: XPath
An XPath that represents the XPath of the element mapped to the XmlMappedRange control.
Examples
The following code example uses the XPath property to remove the XPath of an XmlMappedRange if the XPath is "/ns1:Customer/ns1:LastName". The example then displays the current XPath of the XmlMappedRange. This code example assumes that the current worksheet contains an XmlMappedRange named 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);
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.