Answered by:
searching a word in a file(word/pdf)

Question
-
User1975684512 posted
hi frnds,
Am very new to ASP.NET and now am trying to work with VB.NET.
Am trying to write a code for searching a keyword in a file(word/pdf) by getting the input from the user and finding it very difficult to code. some one help me to overcome this problem
Friday, January 22, 2016 11:19 AM
Answers
-
User197322208 posted
you can use the same from ElasticSearch , that has a .Net package
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, January 22, 2016 7:53 PM -
User-986267747 posted
Hi SrvnaSrvna,
Am trying to write a code for searching a keyword in a file(word/pdf) by getting the input from the user and finding it very difficult to code. some one help me to overcome this problemYou'd like to find keywords in pdf,doc files using ASP.NET, isn't it? You could extract text from various document types, then you could search the word in the text. Please Check the following thread.
http://forums.asp.net/t/1244435.aspx?how+to+find+keywords+in+pdf+doc+files+using+ASP+NET+
https://bytescout.com/products/developer/pdfextractorsdk/find-text-and-get-coordinates-pdf
I hope it's helpful to you.
Best Regards,
Klein zhang
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 25, 2016 8:29 AM -
User1708713926 posted
hi Srvna,
After searching on google, I found a solution of finding and highlighting word in Word document using VB.NET, refer following code:
Shared Sub Main(ByVal args() As String) 'Create Document Dim document As New Document() document.LoadFromFile("E:\Work\Documents\WordDocuments\References.docx") Dim text() As TextSelection = document.FindAllString("forming", False, True) For Each seletion As TextSelection In text seletion.GetAsOneRange().CharacterFormat.HighlightColor = Color.Yellow Next seletion document.SaveToFile("FindHighlight.docx", FileFormat.Docx) System.Diagnostics.Process.Start("FindHighlight.docx") End Sub
for further information, you can refer this article:
As far as I know, it's a .NET word library and it has a free version, check here:
http://www.e-iceblue.com/Introduce/free-doc-component.html
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, January 27, 2016 3:55 AM
All replies
-
User197322208 posted
you can use the same from ElasticSearch , that has a .Net package
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, January 22, 2016 7:53 PM -
User-986267747 posted
Hi SrvnaSrvna,
Am trying to write a code for searching a keyword in a file(word/pdf) by getting the input from the user and finding it very difficult to code. some one help me to overcome this problemYou'd like to find keywords in pdf,doc files using ASP.NET, isn't it? You could extract text from various document types, then you could search the word in the text. Please Check the following thread.
http://forums.asp.net/t/1244435.aspx?how+to+find+keywords+in+pdf+doc+files+using+ASP+NET+
https://bytescout.com/products/developer/pdfextractorsdk/find-text-and-get-coordinates-pdf
I hope it's helpful to you.
Best Regards,
Klein zhang
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 25, 2016 8:29 AM -
User1708713926 posted
hi Srvna,
After searching on google, I found a solution of finding and highlighting word in Word document using VB.NET, refer following code:
Shared Sub Main(ByVal args() As String) 'Create Document Dim document As New Document() document.LoadFromFile("E:\Work\Documents\WordDocuments\References.docx") Dim text() As TextSelection = document.FindAllString("forming", False, True) For Each seletion As TextSelection In text seletion.GetAsOneRange().CharacterFormat.HighlightColor = Color.Yellow Next seletion document.SaveToFile("FindHighlight.docx", FileFormat.Docx) System.Diagnostics.Process.Start("FindHighlight.docx") End Sub
for further information, you can refer this article:
As far as I know, it's a .NET word library and it has a free version, check here:
http://www.e-iceblue.com/Introduce/free-doc-component.html
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, January 27, 2016 3:55 AM