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

how to on bookmark click event by word js api #4993

Open
anybody-1 opened this issue Oct 21, 2024 · 6 comments
Open

how to on bookmark click event by word js api #4993

anybody-1 opened this issue Oct 21, 2024 · 6 comments
Assignees
Labels
Area: Word Issue related to Word add-ins

Comments

@anybody-1
Copy link

i want to listen the bookmark click event by word js api, but i not found the relation api

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Oct 21, 2024
@wangyun-microsoft
Copy link

Hi @anybody-1, can you explain your scenario and why you want this event? Thanks.

@anybody-1
Copy link
Author

anybody-1 commented Oct 22, 2024

Hi @anybody-1, can you explain your scenario and why you want this event? Thanks.

Hi, my scenario is that:
i will check the document where has risk, then i'll show the risk list in add-ins taskpanel, i hope when user click the text where has risk ,i can find the right risk in taskpanel

the method i used is that, i will insert bookmark on the risk text, when user click the bookmark ,i hope know the bookmark id to find the right risk card
i try to use comment or control to accomplish the goal, but it'll be perceived by users, because the comment event api is preview and it's will have a color or comment box, and the control will be has a box . bookmark is the solution that minimizes user perception.
or can you give me some suggestion ?

@wangyun-microsoft
Copy link

Hi,

There are multiple ways to do this:

  1. Use Content Control. You could set content control as invisible so that end users don't see it (appearance). Entering / Exiting content controls can be captured via events.
  2. Annotation related APIs. The risky text can be annotated and highlighted. It shows Card UI to the end users for add-in suggestions. You can also capture the event when annotated text is hovered. https://learn.microsoft.com/en-us/javascript/api/requirement-sets/word/word-api-1-7-requirement-set?view=common-js-preview

@anybody-1
Copy link
Author

Hi,

There are multiple ways to do this:

  1. Use Content Control. You could set content control as invisible so that end users don't see it (appearance). Entering / Exiting content controls can be captured via events.
  2. Annotation related APIs. The risky text can be annotated and highlighted. It shows Card UI to the end users for add-in suggestions. You can also capture the event when annotated text is hovered. https://learn.microsoft.com/en-us/javascript/api/requirement-sets/word/word-api-1-7-requirement-set?view=common-js-preview

Thanks for your suggestion, It seems that the first solution can solve my problem, i will try to it. the annotation is represents an annotation attached to a paragraph, it's can not insert by range. so, it's not meeting my needs, because i want to add a sign in partial text in a paragraph. and I still hope to be able to monitor the click events of bookmarks, just like the comment events in preview api, do you have such a plan ?

@qinliuMSFT qinliuMSFT added Area: Word Issue related to Word add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Oct 23, 2024
@wangyun-microsoft
Copy link

Currently, we don't have plan for bookmark event. You could submit your requirement here: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform/label-name/Office%20Add-ins%20deployment

Thanks.

@anybody-1
Copy link
Author

anybody-1 commented Oct 25, 2024

Currently, we don't have plan for bookmark event. You could submit your requirement here: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform/label-name/Office%20Add-ins%20deployment

Thanks.

Ok, thanks for your suguggestion

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
Projects
None yet
Development

No branches or pull requests

3 participants