Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Visio.SelectionChangedEventArgs interface
- Package:
- visio
Provides information about the shape collection that raised the SelectionChanged event.
Remarks
Used by
Examples
let eventResult; // Global variable to store the EventHandlerResult returned on attaching handler.
function AttachHandler() {
Visio.run(session, function(ctx) {
const doc = ctx.document;
eventResult = doc.onSelectionChanged.add(
function (args) {
console.log("Selected Shape Name: "+args.shapeNames[0]);
});
return ctx.sync().then(function(){
console.log("Handler attached");
});
}).catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
function onSelectionChanged(args) {
console.log(Date.now() + "Selection Changes Event" + JSON.stringify(args));
}
}
function RemoveHandler() {
if (!eventResult || !eventResult.context) {
console.log("Handler has not been attached");
return;
}
Visio.run(eventResult.context, function(ctx) {
eventResult.remove();
return ctx.sync().then(function (){
eventResult = null;
console.log("Handler removed");
});
}).catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
}
Properties
| pageName | Gets the name of the page which has the ShapeCollection object that raised the SelectionChanged event. |
| shapeNames | Gets the array of shape names that raised the SelectionChanged event. |
Property Details
pageName
Gets the name of the page which has the ShapeCollection object that raised the SelectionChanged event.
pageName: string;
Property Value
string
Remarks
shapeNames
Gets the array of shape names that raised the SelectionChanged event.
shapeNames: string[];
Property Value
string[]
Remarks
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
