menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class WComment - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class WComment

    Represents a comment in the Word document.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    Entity
    WidgetBase
    ParagraphItem
    WComment
    Implements
    IXDLSSerializable
    IParagraphItem
    IOfficeRun
    ICompositeEntity
    IEntity
    Inherited Members
    Entity.Clone()
    Entity.IsComposite
    Entity.NextSibling
    Entity.Owner
    Entity.PreviousSibling
    OwnerHolder.Document
    OwnerHolder.m_doc
    ParagraphItem.ApplyStyle(String)
    ParagraphItem.CloneRun()
    ParagraphItem.Dispose()
    ParagraphItem.IsDeleteRevision
    ParagraphItem.IsInsertRevision
    ParagraphItem.m_charFormat
    ParagraphItem.OwnerMathRunElement
    ParagraphItem.OwnerParagraph
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.XDLSHolder
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class WComment : ParagraphItem, IXDLSSerializable, IWidget, IParagraphItem, IOfficeRun, ICompositeEntity, IEntity

    Constructors

    WComment(IWordDocument)

    Initializes a new instance of the WComment class with the specified IWordDocument instance.

    Declaration
    public WComment(IWordDocument doc)
    Parameters
    Type Name Description
    IWordDocument doc

    The IWordDocument instance.

    Fields

    m_format

    Represents the formatting options for the comment.

    Declaration
    protected WCommentFormat m_format
    Field Value
    Type
    WCommentFormat

    m_textBody

    Represents the text body of comment.

    Declaration
    protected WTextBody m_textBody
    Field Value
    Type
    WTextBody

    Properties

    Ancestor

    Returns the parent comment for the specific comment. Read-only

    Declaration
    public WComment Ancestor { get; }
    Property Value
    Type Description
    WComment

    The parent WComment of the specific WComment.

    Remarks

    Returns null for top-level comments.

    Examples
    Load an existing Word document into DocIO instance
    WordDocument document = new WordDocument("Template.docx");
    Get the Ancestor comment
    WComment ancestorComment = document.Comments[1].Ancestor;
    Save and Close the Word document
    document.Save("Sample.docx", FormatType.Docx);
    document.Close();
    'Load an existing Word document into DocIO instance 
    Dim document As WordDocument = New WordDocument("Template.docx")
    'Get the Ancestor comment
    Dim ancestorComment As WComment = document.Comments(1).Ancestor
    'Save and Close the Word document
    document.Save("Sample.docx", FormatType.Docx)
    document.Close()

    ChildEntities

    Gets the child elements of the comment. Read-only.

    Declaration
    public EntityCollection ChildEntities { get; }
    Property Value
    Type Description
    EntityCollection

    The collection of child elements.

    CommentedItems

    Gets the collection of items in the paragraph of the comment.

    Declaration
    public ParagraphItemCollection CommentedItems { get; }
    Property Value
    Type Description
    ParagraphItemCollection

    The paragraph items collection of the comment.

    CommentRangeEnd

    Declaration
    public WCommentMark CommentRangeEnd { get; }
    Property Value
    Type
    WCommentMark

    CommentRangeStart

    Declaration
    public WCommentMark CommentRangeStart { get; }
    Property Value
    Type
    WCommentMark

    Done

    Gets a value indicating whether the comment is resolved or not. The default value is false.

    Declaration
    public bool Done { get; }
    Property Value
    Type Description
    System.Boolean

    True if the comment is resolved; otherwise, false.

    Remarks

    This property is only applicable for DOCX format documents.

    Examples
    // Load an existing Word document into DocIO instance
    using (WordDocument document = new WordDocument("Template.docx"))
    {
    // Checks whether the comment is resolved or not
    bool done = document.Comments[0].Done;
    // Saves the Word document
    document.Save("Sample.docx", FormatType.Docx);
    }
    'Load an existing Word document into DocIO instance 
    Dim document As WordDocument = New WordDocument("Template.docx")
    'Checks whether the comment is resolved or not
    Dim done As Boolean = document.Comments(0).Done
    'Save and Close the Word document
    document.Save("Sample.docx", FormatType.Docx)
    document.Close()

    EntityType

    Gets the type of the entity. Read-only.

    Declaration
    public override EntityType EntityType { get; }
    Property Value
    Type Description
    EntityType

    The EntityType of the current item.

    Overrides
    Entity.EntityType

    Format

    Gets the format options for the comment.

    Declaration
    public WCommentFormat Format { get; }
    Property Value
    Type Description
    WCommentFormat

    The WCommentFormat instance that represents format options of comment.

    TextBody

    Gets the text body of the comment. Read-only.

    Declaration
    public WTextBody TextBody { get; }
    Property Value
    Type Description
    WTextBody

    The WTextBody instance that represents the text body.

    Methods

    AddCommentedItem(IParagraphItem)

    Adds the paragraph item to the commented items.

    Declaration
    public void AddCommentedItem(IParagraphItem paraItem)
    Parameters
    Type Name Description
    IParagraphItem paraItem

    The paragraph item.

    CloneImpl()

    Creates a duplicate copy of the entity.

    Declaration
    protected override object CloneImpl()
    Returns
    Type Description
    System.Object

    An System.Object reference to the newly created instance.

    Overrides
    ParagraphItem.CloneImpl()

    CreateLayoutInfo()

    Creates the layout info.

    Declaration
    protected override void CreateLayoutInfo()
    Overrides
    WidgetBase.CreateLayoutInfo()

    InitXDLSHolder()

    Initialize the XDLS holder.

    Declaration
    protected override void InitXDLSHolder()
    Overrides
    XDLSSerializableBase.InitXDLSHolder()

    RemoveCommentedItems()

    Removes the items in the comment.

    Declaration
    public void RemoveCommentedItems()

    ReplaceCommentedItems(TextBodyPart)

    Replaces the commented items with specified TextBodyPart.

    Declaration
    public void ReplaceCommentedItems(TextBodyPart textBodyPart)
    Parameters
    Type Name Description
    TextBodyPart textBodyPart

    The text body part.

    ReplaceCommentedItems(String)

    Replace the contents of the comment with the specified text.

    Declaration
    public void ReplaceCommentedItems(string text)
    Parameters
    Type Name Description
    System.String text

    The string that specifies the text to replace.

    WriteXmlAttributes(IXDLSAttributeWriter)

    Writes object data as xml attributes.

    Declaration
    protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
    Parameters
    Type Name Description
    IXDLSAttributeWriter writer

    The IXDLSAttributeWriter object.

    Overrides
    XDLSSerializableBase.WriteXmlAttributes(IXDLSAttributeWriter)

    Implements

    IXDLSSerializable
    IParagraphItem
    IOfficeRun
    ICompositeEntity
    IEntity
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved