WorkbookBase.XmlNamespaces Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets an XmlNamespaces collection that represents the XML namespaces contained in the workbook.
public:
property Microsoft::Office::Interop::Excel::XmlNamespaces ^ XmlNamespaces { Microsoft::Office::Interop::Excel::XmlNamespaces ^ get(); };
public Microsoft.Office.Interop.Excel.XmlNamespaces XmlNamespaces { get; }
member this.XmlNamespaces : Microsoft.Office.Interop.Excel.XmlNamespaces
Public ReadOnly Property XmlNamespaces As XmlNamespaces
Property Value
An XmlNamespaces collection that represents the XML namespaces contained in the workbook.
Examples
The following code example uses the XmlNamespaces property to write the Uniform Resource Identifier (URI) for each XmlNamespace in the workbook to column A of worksheet Sheet1
.
This example is for a document-level customization.
private void DisplayXmlNamespaceURI()
{
if (this.XmlNamespaces.Count == 0)
{
MessageBox.Show("The current workbook does not have " +
"any XML namespaces.");
}
else
{
for (int i = 0; i < this.XmlNamespaces.Count; i++)
{
Globals.Sheet1.Range["A" + i].Value2 =
(this.XmlNamespaces[i].Uri);
}
}
}
Private Sub DisplayXmlNamespaceURI()
If Me.XmlNamespaces.Count = 0 Then
MsgBox("The current workbook does not have " & _
"any XML namespaces.")
Else
Dim i As Integer
For i = 0 To (Me.XmlNamespaces.Count)
Globals.Sheet1.Range("A" & i).Value2 = _
Me.XmlNamespaces(i).Uri
Next i
End If
End Sub