OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
658 stars 94 forks source link

Word: `search` can't find text in text boxes #4650

Open greysteil opened 1 week ago

greysteil commented 1 week ago

Provide required information needed to triage your issue

In Word, text in text boxes (w:txbxContent in the OOXML) cannot be found using search(...) on a document's body or any of its ranges. This text is findable when using Word manually (i.e., using the search bar).

Your Environment

Expected behavior

search(...) should behave the same via Office.js as it does when using the search bar in Word. It should find text inside text boxes.

Current behavior

search(...) does not find any text within text boxes.

Steps to reproduce

  1. Add a text box to a document
  2. Attempt to search for the text in the text box using context.document.body.search(...)
  3. Observe that the text in the text box cannot be found

Context

Our add-in includes two features that are negatively affected by this:

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

microsoft-github-policy-service[bot] commented 1 week ago

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

shanshanzheng-dev commented 1 week ago

Hi @greysteil Thanks for reporting this issue, we'll be looking into this and will report back if we have a suggestion for you. Thanks.

jipyua commented 1 week ago

@greysteil thanks for reaching out, for the existing search api, generally we haven't provided support to content in text box yet. So this is so far a by-design behavior. We track Office Add-in feature requests on our Microsoft 365 Developer Platform Ideas Forum. Please add your request there. Feature requests on are considered when we go through our planning process. Thanks.

microsoft-github-policy-service[bot] commented 1 day ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!