Skip to content

Instantly share code, notes, and snippets.

@nbelyh
Last active August 28, 2017 19:35
Show Gist options
  • Save nbelyh/4d82bdbeefa62eb7e04c5466db46348a to your computer and use it in GitHub Desktop.
Save nbelyh/4d82bdbeefa62eb7e04c5466db46348a to your computer and use it in GitHub Desktop.
VisioOnline: Comment Object example. https://dev.office.com/reference/add-ins/visio/comment.
Visio.run(function (ctx) {
var activePage = ctx.document.getActivePage();
var shapeName = "Position Belt.41";
var shape = activePage.shapes.getItem(shapeName);
var shapecomments= shape.comments;
shapecomments.load();
return ctx.sync().then(function () {
for(var i=0; i<shapecomments.items.length;i++)
{
var comment= shapecomments.items[i];
console.log("comment Author: " + comment.author);
console.log("Comment Text: " + comment.text);
console.log("Date " + comment.date);
}
});
}).catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment