Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Comment Class

Comment.When the object is serialized out as xml, its qualified name is p:cm.

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

public class Comment : OpenXmlCompositeElement

The following table lists the possible child types:

  • Position <p:pos>

  • Text <p:text>

  • ExtensionListWithModification <p:extLst>

[ISO/IEC 29500-1 1st Edition]

19.4.1 cm (Comment)

This element specifies a single comment attached to a slide. It contains the text of the comment, its position on the slide, and attributes referring to its author and date.


<p:cm authorId="0" dt="2006-08-28T17:26:44.129" idx="1">
  <p:pos x="10" y="10"/>
  <p:text>Add diagram to clarify.</p:text>

end example]

Parent Elements

cmLst (§19.4.4)

Child Elements


extLst (Extension List with Modification Flag)


pos (Comment Position)


text (Comment's Text Content)




authorId (Comment Author ID)

This attribute specifies the author of the comment. It refers to the ID of an author in the comment author list for the document.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

dt (Comment Date/Time)

This attribute specifies the date and time this comment was last modified.

The possible values for this attribute are defined by the W3C XML Schema dateTime datatype.

idx (Comment Index)

This attribute specifies an identifier for this comment that is unique within a list of all comments by this author in this document. An author's first comment in a document has index 1.

[Note: Because the index is unique only for the comment author, a document can contain multiple comments with the same index created by different authors. end note]

The possible values for this attribute are defined by the ST_Index simple type (§19.7.3).

[Note: The W3C XML Schema definition of this element’s content model (CT_Comment) is located in §A.3. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft