Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sat Mar 13, 2021 3:15 am

Hi Team,

Please help us to identify whether a paragraph is a Bookmark/Hyperlink. If it is then get only the text without any formation.

Example:
My_Bookmark (which will point to first item of TOC)

When we read the "My_Bookmark" through paragraph.getText(), it returns something like HYPERLINK \l "_Toc325455565" My_Bookmark

We first want to check whether a paragraph is bookmark or not and if it is a bookmark, then we want the same text which is there inside word file without any HYPERLINK blah blah prepended on it.

Thanks in advance.

pr20080798
 
Posts: 148
Joined: Wed Jan 20, 2021 1:15 pm

Mon Mar 15, 2021 7:52 am

Hello,

Thanks for your inquiry!

Kindly note that a paragraph is not a Bookmark/Hyperlink, the marks (BookmarkStart, BookmarkEnd) of the bookmark are included in the paragraph as a child object, and the content of the bookmark can be placed in multiple paragraphs. Please refer to the following article to get bookmark text in Java: Get Bookmark Text in Java.

If the article does not match your needs, please provide us with your input file so that we can make the demo for you. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Mar 30, 2021 6:10 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc