Last active
August 28, 2017 19:35
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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