Aracılığıyla paylaş


XMLNode.BaseName Özellik

Adını alır XMLNode denetim olmadan herhangi bir önek.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property BaseName As String
string BaseName { get; }

Özellik Değeri

Tür: System.String
Adı XMLNode denetim olmadan herhangi bir önek.

Örnekler

Aşağıdaki kod örneği Attributes özellik bir öznitelik eklemek için bir XMLNode denetim.NamespaceURI Özelliği, şema ad alanı belirtmek için kullanılır.Örnek sonra her öznitelik arasında dolaşır XMLNode ve öznitelik adı ve değeri görüntüler.Adı XMLNode den alınan BaseName özelliği.Bu örnek, geçerli belge içerdiğini varsayar bir XMLNode adlı CustomerNode olan bir NewCustomer öznitelik şemada bildirilmiş.

Private Sub DisplayAttributes()
    Dim newAttribute As Word.XMLNode = _
        Me.CustomerNode.Attributes.Add("NewCustomer", _
        Me.CustomerNode.NamespaceURI)
    newAttribute.NodeValue = "yes"

    Dim attribute1 As Word.XMLNode
    For Each attribute1 In Me.CustomerNode.Attributes
        MsgBox("'" & Me.CustomerNode.BaseName & _
            "' has the attribute '" & attribute1.BaseName & _
            "' with the value '" & attribute1.NodeValue & "'.")
    Next attribute1
End Sub
private void DisplayAttributes()
{
    Word.XMLNode newAttribute = 
        this.CustomerNode.Attributes.Add("NewCustomer",
        this.CustomerNode.NamespaceURI, ref missing);
    newAttribute.NodeValue = "yes";

    foreach (Word.XMLNode attribute1 in this.CustomerNode.Attributes)
    {
        MessageBox.Show("'" + this.CustomerNode.BaseName +
            "' has the attribute '" + attribute1.BaseName +
            "' with the value '" + attribute1.NodeValue +
            "'.");
    }
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

XMLNode Arabirim

Microsoft.Office.Tools.Word Ad Alanı