Coder Social home page Coder Social logo

Comments (8)

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024 1

Hi @shanshanzheng-dev .
Is this okay or I am missing something.
If you need some other detail for this please let me know .
I'm stuck due to this can you please help.
Thanks.

from office-js.

jipyua avatar jipyua commented on August 10, 2024 1

hi @Jayshiv1408Dev, we'd like to understand more of your scenario about the missing JS API. Would ou please help fill out this form with your contact information as a means for us to further discuss. Thanks.
https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR9NvrlmrippKsMvh4kTM325URVZMWjYyQTVOTVNLTUo5VzFRTTcyNU1RSy4u

from office-js.

shanshanzheng-dev avatar shanshanzheng-dev commented on August 10, 2024

Hi @Jayshiv1408Dev Thanks for reaching us. Could you please give us more detail info for your scenario about what you want to do or your issue? such as you want to use office API JS to set character 'st' as superscript/subscript/strike? May I know you want to implement on Word Online or Word desktop? Thanks.

from office-js.

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024

Hi @shanshanzheng-dev, Thanks for your quick response.
Sorry for inconvenience I forget to add details.

My Environment
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

I'm taking value from excel and putting that into my word table.
In that some cell has superscript or subscript on some character so I want to give that style to particular character only.

word table cell has this text **21st Jan 2022**
supText="st"; 
 const searchResults = cell.body.search(supText, { ignoreSpace: true });
 context.load(searchResults);
 await context.sync();
 searchResults.items[0].font.superscript = true;

It's working fine until this kind of value is come
image

As given Image you can see 21st and 22nd January.
For this text when I used Below code Its giving me this kind of output.
I know I used 0 index that's why its happening.
Is there way I can Search text based on index Or I can get range base on start-index and length/endIndex
image

from office-js.

jipyua avatar jipyua commented on August 10, 2024

hi @Jayshiv1408Dev thanks for reaching out. After inspecting the questions mentioned above, I am afraid so far there is no existing API to get range based on start-index and length/endIndex. This will be a new feature ask, we track Office Add-in feature requests on our Microsoft 365 Developer Platform Ideas Forum. Please add your request there. Feature requests on are considered when we go through our planning process. Thanks,

from office-js.

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024

@jipyua Thanks,
Is there other way I can achieve this.

from office-js.

jipyua avatar jipyua commented on August 10, 2024

hi @Jayshiv1408Dev I am afraid so far there is no directly available APIs for your request, there is a split API here https://learn.microsoft.com/en-us/javascript/api/word/word.range?view=word-js-preview#word-word-range-split-member(1) for spliting ranges, but please validate whether you can find suitable delimiters for your purposes. Thanks.

from office-js.

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024

Thanks @jipyua and @shanshanzheng-dev for your help.
I'll check this api.

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.