Based on your description, here is a likely technical approach for Aspose.Diagram.
You can read the author of a comment the same way you read the comment text – the Annotation object also exposes an Author cell.
// load the Visio document
Diagram diagram = new Diagram(@"C:\MyVisio.vsdx");
// collect author‑comment pairs (here we walk all pages)
var authorComments = new Dictionary<string, List<string>>();
foreach (Page page in diagram.Pages)
{
foreach (Annotation ann in page.PageSheet.Annotations)
{
string author = ann.Author?.Value ?? "Unknown";
string comment = ann.Comment?.Value ?? string.Empty;
if (!authorComments.ContainsKey(author))
authorComments[author] = new List<string>();
authorComments[author].Add(comment);
}
}
// example output
foreach (var kvp in authorComments)
{
Console.WriteLine($"Author: {kvp.Key}");
foreach (string c in kvp.Value)
Console.WriteLine($" Comment: {c}");
}
The Annotation.Author cell gives you the name of the user who created the comment; you can then group the comments by that author as shown.
Clarifying questions
Which version of Aspose.Diagram for .NET are you using (e.g., 23.x, 22.x, etc.)?
Do you need the author‑comment list aggregated across the whole document, or separately for each page?
I am using version 25.11.0.0 for aspose diagram and it do not have annotation.author.
see below class
namespace Aspose.Diagram
{
//
// Summary:
// Contains elements that contain information about comments inserted into a document
// page.
public class Annotation
{
//
// Summary:
// The shape ID of the comment.
public int ShapeID { get; set; }
//
// Summary:
// The zero-based index of the element within its parent element.
public int IX { get; set; }
//
// Summary:
// A flag indicating whether the element has been deleted locally. A value of 1
// indicates that the element was deleted locally.
public BOOL Del { get; set; }
//
// Summary:
// The x-coordinate of the comment marker in page coordinates.
public DoubleValue X { get; }
//
// Summary:
// The y-coordinate of the comment marker in page coordinates.
public DoubleValue Y { get; }
//
// Summary:
// Contains the ID number of the reviewer adding markup to the document.
public IntValue ReviewerID { get; }
//
// Summary:
// Specifies the index number assigned to a comment marker.
public IntValue MarkerIndex { get; }
//
// Summary:
// specifies when a comment was created
public DateValue Date { get; }
//
// Summary:
// Specifies when a comment was last changed
public DateValue EditDate { get; }
//
// Summary:
// Contains the comment text in string format for a shape.
public Str2Value Comment { get; }
//
// Summary:
// Indicates the locale ID (LCID) of the language in which the cell formula, text,
// custom property, or comment was entered.
public IntValue LangID { get; }
}
}
Thanks
Based on your description, here is a likely technical approach for Aspose.Diagram.
In version 25.11 the Annotation object does not expose an Author cell directly; the author is stored as a reviewer ID.
You can read the ReviewerID from the annotation and then look up the reviewer’s name in the diagram’s Reviewers collection (each reviewer has a Name property).
// load the Visio file
Diagram diagram = new Diagram(@"C:\MyVisio.vsdx");
// iterate pages and annotations
foreach (Page page in diagram.Pages)
{
foreach (Annotation ann in page.PageSheet.Annotations)
{
// reviewer ID of the comment
int revId = ann.ReviewerID.Value;
// find the reviewer object (index is zero‑based)
Reviewer reviewer = diagram.Reviewers[revId];
string author = reviewer?.Name?.Value ?? "Unknown";
string comment = ann.Comment?.Value ?? string.Empty;
Console.WriteLine($"Author: {author}");
Console.WriteLine($"Comment: {comment}");
}
}
This groups each comment with the name of the reviewer who created it.
Clarifying questions
Does the Visio file contain reviewer entries (i.e., a non‑empty diagram.Reviewers collection)?
Are you able to access the Reviewer class and its Name property in your project, or do you need the exact class/member names for that collection?
this works for me, only i have issue with get reviewer as it directly not exists,
I tried to get it using below code but , it seems it only works with index not based on provided reviewID value, so below line causing issue ,
Reviewer reviewer = diagram.DocumentSheet.Reviewers[revId];
@Viral84
We have already added this method in version Aspose.Diagram v26.1.
Please update to version Aspose.Diagram v26.1 or Aspose.Diagram v26.2.
Thanks.