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 Sep 09, 2014 9:15 am
Hello,
I want to make a search in a specified table cell text, so i think i must use FindStringInLine, but how to specifi the bodyregion of the tablecell please?
Thank you
-
tarikzaid
-
- Posts: 29
- Joined: Wed Aug 06, 2014 7:16 am
Tue Sep 09, 2014 9:53 am
Hello,
Thanks for your inquiry.
Please try the following code.
- Code: Select all
TableCell cell = table.Rows[0].Cells[0];
List<TextSelection> selects = new List<TextSelection>();
foreach (Paragraph p in cell.Paragraphs)
{
TextSelection[] finds = doc.FindStringInLine(p as BodyRegion,"key", true, true);
selects.AddRange(finds.ToArray());
}
Best wishes,
Amy
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am
Fri Sep 12, 2014 10:13 am
Hello,
Does the code resolve your issue?
Thanks for your feedback.
Please feel free to contact us if you have any problem.
Best wishes,
Amy
E-iceblue support team
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am