You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation gives instructions on how to register and then unregister events, but the provided code example isn't valid and doesn't work even in the most basic sense.
the eventContext.context provided as a param in the Word.run has a type mismatch and is not working.
trying to work around the issue by casting doesn't resolve the issue and just leads to the Word.run to throw
also the example provided doesn't take into account the possibility that eventContext could potentially be undefined or null, which is also wrong but easily fixed by adding some if(eventContext) where needed.
Questions
Is there another approved way of registering/unregistering events that I haven't found in the documentation?
Is there other ways to get notified of document changes that do not rely on the events?
The text was updated successfully, but these errors were encountered:
Article URL
https://learn.microsoft.com/en-us/office/dev/add-ins/word/word-add-ins-events#remove-an-event-handler
Issue
The documentation gives instructions on how to register and then unregister events, but the provided code example isn't valid and doesn't work even in the most basic sense.
the
eventContext.context
provided as a param in theWord.run
has a type mismatch and is not working.trying to work around the issue by casting doesn't resolve the issue and just leads to the
Word.run
to throwalso the example provided doesn't take into account the possibility that
eventContext
could potentially be undefined or null, which is also wrong but easily fixed by adding someif(eventContext)
where needed.Questions
Is there another approved way of registering/unregistering events that I haven't found in the documentation?
Is there other ways to get notified of document changes that do not rely on the events?
The text was updated successfully, but these errors were encountered: