OfficeDev / office-js-docs-reference

Microsoft Office JavaScript API Reference
https://learn.microsoft.com/javascript/api/overview
MIT License
115 stars 66 forks source link

AttachHandler error #493

Closed openmindgap closed 5 years ago

openmindgap commented 5 years ago

"OSF is not defined"

Fix: Visio.run(function(ctx)... should be Visio.run(session, function(ctx)...

as per this issue report https://github.com/OfficeDev/office-js-docs/issues/1375

Please make the documentation more verbose, for example where to call AddHandler()


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

AlexJerabek commented 5 years ago

Hi @openmindgap,

I'll correct the error in the sample. I'll also investigate how to best improve the documentation. In the meantime, I'd recommend either asking about your Visio add-in's design on StackOverflow using the "office-js" tag, looking at the eventing documents and samples for Excel.

AlexJerabek commented 5 years ago

Hi @openmindgap,

I've corrected the sample code to use the session parameter. Those changes should be live in the documentation soon.

As for the larger sample on integrating the event handlers into your Visio add-in, we'll add that work to the documentation team's backlog. Off-hand, you should be able to add the handlers in your add-in's initialization logic. In this sample, that would be in the initEmbeddedFrame function. The community on StackOverflow should also be able to help you with the implementation details.

I'll go ahead and close this issue for now, as there's no further actions to take in this repo. Please respond to the thread if you disagree with the issue closure.