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
'Декларация
Public Sub SetAttribute ( _
openXmlAttribute As OpenXmlAttribute _
)
'Применение
Dim instance As OpenXmlElement
Dim openXmlAttribute As OpenXmlAttribute
instance.SetAttribute(openXmlAttribute)
public void SetAttribute(
OpenXmlAttribute openXmlAttribute
)
Parameters
- openXmlAttribute
Type: DocumentFormat.OpenXml.OpenXmlAttribute
The attribute to be set on the element.
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. |