Add Comments to Drawings in Visio


Below is the code to add comments in diagram:

  Page mypage= Application.ActiveDocument.Pages[1];



The AddComment method, exposed by the Page class, allows you to add comments to a drawing page. It takes the X and Y coordinates along with a comment string.Below is the code snippet:

  // Load diagram

 Diagram diagram = new Diagram("Drawing1.vsd");

 // Add comment

 diagram.Pages[0].AddComment(7.205905511811023, 3.880708661417323, "test@");

 // Save diagram

 diagram.Save("Output.vdx", SaveFileFormat.VDX);

Download Sample Code

Download Running Code