简体   繁体   中英

Is there a way to get the paragraph number using office word js api from the range object or the paragraph itself?

Can someone please let me know if there is any way that I could retrieve the paragraph number from a paragraph or the range object using office word js api? Working on implementing selections based on data that I get from a back end service, which provides both paragraph numbers and offsets. But, the paragraph numbers seem to be off by the cumulative number of table rows found in the document.

Currently there is no office js api to retrieve the paragraph number from a paragraph or the range object. But I think you can get all of the paragraphs and iterate everyone to set the index number to every paragraph. Thus, you could calculate any paragraph number.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM