Click or drag to resize

OpenXmlElementSetAttribute Method

Sets an attribute to the specified 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) Version: 2.20.0+Branch.release-v2.20.0.Sha.a873d3fbff9bffe179fea62486da950adf5be65d.a873d3fbff9bffe179fea62486da950adf5be65d
Syntax
public void SetAttribute(
	OpenXmlAttribute openXmlAttribute
)

Parameters

openXmlAttribute  OpenXmlAttribute
The attribute to be set on the element.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when the LocalName of the "openxmlAttribute" parameter is null or empty.
InvalidOperationExceptionThrown when an attempt to set a namespace declaration is made.
See Also