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.

Tue May 31, 2022 4:45 pm

I am using findAllPattern to search for patterns over the entire word document. As I have been able to verify, when the pattern is between several paragraphs, it does not find them. Therefore the result of findAllPattern only returns complete patterns within each paragraph. I would like to know if this behavior is so. My goal is to find all the patterns in the document and replace them with other content.
Thanks.

jmparada
 
Posts: 47
Joined: Wed May 25, 2022 7:50 am

Wed Jun 01, 2022 8:40 am

Hello,

Thanks for your inquiry.

If you need to match the content cross multiple paragraphs, please try the method below. If this is not you need, please give a more detailed description.

Code: Select all
//true = use advance search
TextSelection[] selections=doc.findAllPattern(pattern,true);
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Jun 01, 2022 5:31 pm

It has worked well, thank you. In the documentation of the classes there is no option for that second boolean parameter.

jmparada
 
Posts: 47
Joined: Wed May 25, 2022 7:50 am

Thu Jun 02, 2022 9:23 am

Hi,

Sorry, We do not update the documentation very frequently, and I will urge relevant colleagues to update them.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Fri Jun 03, 2022 11:58 am

For reasons of the use that I am giving it, I need to search with findPattern to only search the first one that it finds. In this case this method does not allow me the second parameter "true" to search in several paragraphs. No problem because I can always use findAllPattern and stick with the first one. I only mention it because it could be an improvement to include.
Thanks.

jmparada
 
Posts: 47
Joined: Wed May 25, 2022 7:50 am

Mon Jun 06, 2022 7:10 am

Hello,

Thanks for your advice. I will feed it back to our development team.
Have a nice day!
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Mon Jun 13, 2022 11:55 am

I just found another problem with this. The findAllPattern method, with the second parameter set to true, works well between paragraphs as we have seen in previous posts. Now I have found that it does not work if, in addition to paragraphs, there are images, tables or lists.

jmparada
 
Posts: 47
Joined: Wed May 25, 2022 7:50 am

Tue Jun 14, 2022 2:24 am

Hi,

Thanks for your feedback.

We do not support this situation. Sorry for the inconvenience caused.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Doc