Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word DocumentSelectionChanged event not firing when selecting a comment in a Word document by clicking on the comment in the interface #4394

Open
iShtopoR opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
Area: Word Issue related to Word add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@iShtopoR
Copy link

iShtopoR commented Apr 24, 2024

Version: Word Online.

I'm facing is that I'm using

Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, (event: any) => { 
    console.log("event", event);
}); 

to track changes in the getSelection method in a Word document within my Add-in plugin. I aim to retrieve the content of a comment. However, when selecting a comment through the interface, the selection doesn't change, thus preventing me from accessing the comment's content.

const comments = context.document.getSelection().getComments();
comments.load("items");
await context.sync();
comments.items.forEach((comment: Word.Comment) => {
    console.log("Comment: ", comment.content);
});

image

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Apr 24, 2024
@davidchesnut davidchesnut added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Word Issue related to Word add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Word Issue related to Word add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback
Projects
None yet
Development

No branches or pull requests

4 participants