FieldCommentsText Property

Gets or sets the text of the comments.

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public string Text { get; set; }

Property Value

Type: String
Examples
Shows how to use the COMMENTS field to display a document's comments.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// This property is where the COMMENTS field will source its content from
doc.BuiltInDocumentProperties.Comments = "My comment.";

// Insert a COMMENTS field with a document builder
FieldComments field = (FieldComments)builder.InsertField(FieldType.FieldComments, true);
field.Update();

Assert.AreEqual("My comment.", field.Result);

// We can override the comment from the document's built in properties and display any text we put here instead
field.Text = "My overriding comment.";
field.Update();

Assert.AreEqual("My overriding comment.", field.Result);

doc.Save(ArtifactsDir + "Field.COMMENTS.docx");
See Also