Freigeben über


WorkbookBase.XmlNamespaces-Eigenschaft

Ruft eine Microsoft.Office.Interop.Excel.XmlNamespaces-Auflistung ab, die die in der Arbeitsmappe enthaltenen XML-Namespaces darstellt.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property XmlNamespaces As XmlNamespaces
    Get
public XmlNamespaces XmlNamespaces { get; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Excel.XmlNamespaces
Eine Microsoft.Office.Interop.Excel.XmlNamespaces-Auflistung, die die in der Arbeitsmappe enthaltenen XML-Namespaces darstellt.

Beispiele

Im folgenden Codebeispiel wird mithilfe der XmlNamespaces-Eigenschaft der URI (Uniform Resource Identifier) für jeden XmlNamespace in der Arbeitsmappe in Spalte A des Sheet1-Arbeitsblatts geschrieben.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

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-Sicherheit

Siehe auch

Referenz

WorkbookBase Klasse

Microsoft.Office.Tools.Excel-Namespace