Udostępnij za pośrednictwem


Workbook.XmlNamespaces Property (2007 System)

Gets an XmlNamespaces collection that represents the XML namespaces contained in the workbook.

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 XmlNamespaces As XmlNamespaces
'Usage
Dim instance As Workbook 
Dim value As XmlNamespaces 

value = instance.XmlNamespaces
[BrowsableAttribute(false)]
public XmlNamespaces XmlNamespaces { get; }
[BrowsableAttribute(false)]
public:
property XmlNamespaces^ XmlNamespaces {
    XmlNamespaces^ get ();
}
public function get XmlNamespaces () : XmlNamespaces

Property Value

Type: XmlNamespaces
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 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
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, missing].Value2 =
                (this.XmlNamespaces[i].Uri);
        }
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace