Coder Social home page Coder Social logo

Comments (4)

Kaidali avatar Kaidali commented on August 10, 2024

Hi, thanks for telling us about this issue. But I tried with your code, it give me correct search results.
So can you please provide more information about the error you got? Do you run this code with other functions? Thanks.

from office-js.

Foundasys avatar Foundasys commented on August 10, 2024

Hi, I'm running the code in Google Chrome and use Cloud9 IDE to code in.

I will try Visual studio code and see if the error persists.
When running (just the code and nothing else) the code I also get the correct results but then the error.

Google Chrome:
image

Edge:
image

from office-js.

Foundasys avatar Foundasys commented on August 10, 2024

Just searching for the word 'the' for example results in no errors. Maybe it's the wildcard option?

/* global Office, Word, OfficeExtension */

'use strict';

(function() {

    console.clear();

    Office.initialize = function(reason) {

        function ready() {

            Word.run(function(context) {
                    var options = Word.SearchOptions.newObject(context);
                    options.matchWildCards = false;

                    var searchResults = context.document.body.search('the', options);
                    context.load(searchResults, 'text');

                    return context.sync().then(function() {
                        console.log(JSON.stringify(searchResults.items));
                    });
                })
                .catch(function(error) {
                    console.log('Error: ' + JSON.stringify(error));
                    if (error instanceof OfficeExtension.Error) {
                        console.log('Debug info: ' + JSON.stringify(error.debugInfo));
                    }
                });

        }

        if (document.readyState !== 'loading') {
            ready();
        }
        else {
            document.addEventListener('DOMContentLoaded', ready);
        }
    };
}());

from office-js.

Foundasys avatar Foundasys commented on August 10, 2024

Sorry for the delay but this is no longer an issue anymore. Search works fine now.

from office-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.