Export (0) Print
Expand All

OpenXmlElement.SetAttribute 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)

public void SetAttribute(
	OpenXmlAttribute openXmlAttribute
)

Parameters

openXmlAttribute
Type: DocumentFormat.OpenXml.OpenXmlAttribute

The attribute to be set on the element.

ExceptionCondition
ArgumentNullException

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

InvalidOperationException

Thrown when an attempt to set a namespace declaration is made.

Community Additions

Show:
© 2014 Microsoft