FieldCommentsText Property |
Namespace: Aspose.Words.Fields
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");