1
votes

When attempting to run a Paragraph.search an exception is raised if the Find, Replace, or Goto window is open.

GeneralException: GeneralException at Anonymous function (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:21:202747) at yi (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:21:235283) at st (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:21:235370) at d (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:21:235190) at c (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:21:233776)

ranges = paragraph.search(text, { matchCase: !caseInsensitive, ignoreSpace: true});

Any ideas? If this is not workable it'd be nice to at least get a better exception so we can tell a user how to fix it (close the modal in order to navigate).

1

1 Answers

0
votes

Sorry for the late reply. Great question and Yes, this is by design, sorry! The reason why this happens is because the search parameters (i.e. the settings you are using for case insensitive, ignore spaces among others) are single global and we don't want the API to interfere with the end user search experience. At the same time having he user search both using an add-in and the built-in search seemed edgy. That said I will work with the team to see if we can add a specific exception for this to give you more control. The ETA for this is undefined though.