From bb536d02cad48a3ff18fed998c72a6d417592308 Mon Sep 17 00:00:00 2001 From: Tino Hager Date: Mon, 11 Mar 2024 15:37:32 +0100 Subject: [PATCH] Update taskpane.ts --- src/word-plugin/src/taskpane/taskpane.ts | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/word-plugin/src/taskpane/taskpane.ts b/src/word-plugin/src/taskpane/taskpane.ts index 5ac8df2..a95b719 100644 --- a/src/word-plugin/src/taskpane/taskpane.ts +++ b/src/word-plugin/src/taskpane/taskpane.ts @@ -58,20 +58,11 @@ export async function insertTextIntoRange() { for (let i = 0; i < words.items.length; ++i) { const word = words.items[i]; - if (word.text !== "Lorem") { - continue; - } + // if (word.text !== "Lorem") { + // continue; + // } - // const charRangeCollection = word.search("?", { - // matchWildcards: true, - // matchCase: false, - // ignoreSpace: true, - // ignorePunct: true, - // matchPrefix: false, - // matchSuffix: false, - // matchWholeWord: false, - // }); - const charRangeCollection = word.search("*", { + const charRangeCollection = word.search("?", { matchWildcards: true, matchCase: false, ignoreSpace: true, @@ -80,6 +71,18 @@ export async function insertTextIntoRange() { matchSuffix: false, matchWholeWord: false, }); + // const charRangeCollection = word.search("*", { + // matchWildcards: true, + // matchCase: false, + // ignoreSpace: true, + // ignorePunct: true, + // matchPrefix: false, + // matchSuffix: false, + // matchWholeWord: false, + // }); + + //const charRangeCollection = word.getRange().split([""]); + charRangeCollectionCache.push(charRangeCollection); } } @@ -110,6 +113,7 @@ export async function insertTextIntoRange() { } } else { //charRanges.items[z].font.bold = false; + break; } } }