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
688 stars 95 forks source link

Office JS API: searchResults not returning results for tables having shape format applied to it. #4943

Open GajananVadekar opened 1 month ago

GajananVadekar commented 1 month ago

Platform : PC desktop Host: Word Office version number: Microsoft® Word for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit Operating System: Microsoft Windows 11 pro.

Hi team, I am encountering an issue when using the Office JavaScript API to search for specific patterns inside a Word document, specifically within tables that are in a shape format. The search works fine for regular tables, but does not return results for tables embedded in a shape.

I am attempting to search for numeric patterns (e.g., [0-9.,]{1,}) throughout the document, including inside tables.

range = context.document.body;
searchResults = range.search('[0-9.,]{1,}', { matchWildcards: true });
searchResults.load("text,font/highlightColor,parentTableOrNullObject/isNull,parentContentControlOrNullObject");
await context.sync();

While this code successfully returns results for regular tables, it does not work for tables that are embedded within shapes. Are there any specific properties, methods, or techniques that should be used to handle this scenario?

Expected Behavior: The searchResults should return matches for numeric patterns within both regular tables and tables inside shapes.

Actual Behavior: The searchResults return no matches for content inside tables embedded in a shape, even though numeric patterns are present in those tables.

Additional Information: I have attached the Word document containing the specific table in shape format where the issue occurs for further investigation.

TestDocument.docx

EsterBergen commented 1 month ago

@wangyun-microsoft - Can you please look into this?

qinliuMSFT commented 1 month ago

Hi @GajananVadekar , thank you for reporting this issue, I can reproduce this issue on win32 application. It has been put on our backlog #9414799, product team will follow up and we will reply to you as soon as there is progress.

GajananVadekar commented 2 weeks ago

Hi @qinliuMSFT , Is there any update on when this backlog will be prioritized, and if any progress has been made so far?