How to find whether strikeThrough /underline is present in word document using office.js

243 Views Asked by At

I am working on Word web-in using office.js.

I have a requirement like when I load the document on word if user makes any strikeThrough or Underline in the document.Need to retrieve the value whether it is True/False.

As of now I am able to retrieve the value for current selection.But here I need the value on the whole document

Example:-It might be one letter/one word.Basically It should return results by searching in whole document(n no of pages).

Word.run(function (context) {
            var range = context.document.body;
            range.load('font');
            return context.sync()
                .then(function () {
                    console.log("Font: " + range.font.strikeThrough);
                    console.log("Size: " + range.font.size);

                });
        });

So It always shows value as "false" though word marked as strikeThrough in total document that was loaded on Word.

Can some one please help me.

1

There are 1 best solutions below

1
On