GroupDocsGists
10/19/2017 - 11:22 AM

UpdateDocumentComment.cs

// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET
// initialize DocFormat
DocFormat docFormat = new DocFormat(Common.MapSourceFilePath(filePath));

// extract comments
DocComment[] comments = docFormat.ExtractComments();

if (comments.Length > 0)
{
    // get first comment if exist
    var comment = comments[0];

    // change comment's author
    comment.Author = "Jack London";

    // change comment's text
    comment.Text = "This comment is created using GroupDocs.Metadata";

    // update comment
    docFormat.UpdateComment(comment.Id, comment);
}

// save file in destination folder
docFormat.Save(Common.MapDestinationFilePath(filePath));

Console.WriteLine("File saved in destination folder.");