![Aspose.Diagram for .NET logo Aspose.Diagram for .NET logo](http://blog.aspose.com/wp-content/uploads/sites/2/2013/06/aspose-Diagram-for-net_100.png)
Add Comments to a Visio Shape
The recent version 17.7 of Aspose.Diagram API allows to add comments to any Visio shape in the drawing and the shape-level comments will stay with the shape even if it is moved around. In order to read a comment, click the comment icon beside the shape and the comment will open. In order to close the comment, click on a blank area of the page. Developers can use the following code example to add comments to a Visio shape:C#
// load diagramJava
Diagram diagram = new Diagram(@"c:\temp\Drawing1.vsdx");
// retrieve page by name
Aspose.Diagram.Page page = diagram.Pages.GetPage("Page-1");
// retrieve shape by ID
Aspose.Diagram.Shape shape = page.Shapes.GetShape(12);
page.AddComment(shape, "Hello");
// save diagram
diagram.Save(@"c:\temp\Drawing1.vsdx", SaveFileFormat.VSDX);
// load diagramBesides this, the mechanism of retrieving SolutionXML elements and page information from the Visio drawing has been improved. The recent version also comprises a series of bug fixes. In general, it improves export of Visio drawings to SVG, VSDX and image formats as well as preserves the page-level comments on the Visio drawings.
Diagram diagram = new Diagram("c:\\temp\\Drawing1.vsdx");
// retrieve page by name
Page page = diagram.getPages().getPage("Page-1");
// retrieve shape by ID
Shape shape = page.getShapes().getShape(12);
page.addComment(shape, "Hello");
// save diagram
diagram.save("c:\\temp\\Drawing1.vsdx", SaveFileFormat.VSDX);
Public API Changes
The following API change in the new version is worth noticing:- AddComment(shapeinstance, "comment string") method is added in the Shape class. It helps to add comments to a shape.
Aspose.Diagram for .NET Resources
The following resources will help you work with Aspose.Diagram for .NET:- Home page for Aspose.Diagram API.
- Aspose.Diagram API wiki docs– Help documentation and API reference documents.
- Aspose.Diagram product family forum– Post your technical questions, queries and any other problem you faced while running Aspose.Diagram APIs.
- Enable email subscription– Do not limit yourself, stay up-to-date with the latest news about the Aspose.Diagram APIs and new features, fixes, plus other API related topics by subscribing to Aspose.Diagram blog.
- Aspose.Diagram for .NET Examples– We have published our code examples on the social coding website GitHub.com. Anyone can explore the code examples for learning purposes.
- Aspose.Diagram for Java Examples – We have published our code examples on the social coding website GitHub.com. Anyone could explore the code examples for learning purposes.
The post Add comments to the Shapes in Visio Drawing with Aspose.Diagram API version 17.7 appeared first on Blog - Aspose.com.