Compartir a través de


OpenXmlElement.SetAttribute Method

Set an attribute to the element. If the attribute is a known attribute, the value of the attribute is set. If the attribute is an extended attribute, the 'openxmlAttribute' is added to the extended attributes list.

Namespace:  DocumentFormat.OpenXml
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Sub SetAttribute ( _
    openXmlAttribute As OpenXmlAttribute _
)
'Usage
Dim instance As OpenXmlElement
Dim openXmlAttribute As OpenXmlAttribute

instance.SetAttribute(openXmlAttribute)
public void SetAttribute(
    OpenXmlAttribute openXmlAttribute
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

Thrown when the LocalName of the "openxmlAttribute" parameter is null or empty.

InvalidOperationException

Thrown when attempting to set a namespace declaration.

See Also

Reference

OpenXmlElement Class

OpenXmlElement Members

DocumentFormat.OpenXml Namespace