搜索引擎/功能,可搜索PDF和DOC文档中的所有单词/文本 [英] Search engine/function that searches ALL the words/text inside the PDF and DOC documents

查看:148
本文介绍了搜索引擎/功能,可搜索PDF和DOC文档中的所有单词/文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正要把最后一根头发拔掉.有谁知道如何创建一个功能或几行或两行代码来实际搜索PDF或DOC中的所有文本?我一直在研究各种各样的想法,但从未遇到过这个想法.我不想搜索标题,我需要搜索这两种文件类型的正文中的实际文本.我希望这有意义吗?

Hi all,
I am just about to pull my last hairs out. Does anyone know of how to create a function or some line or two of code that actually searches ALL text within a PDF or DOC? I have been playing around with all sorts of ideas but have never came across this one. I do not want to search the title, I need to search the actual text in the body of these two file types. I hope this makes sense?

推荐答案

您不能在一个函数中做到这一点!

我无法在ASP.NET中为您提供帮助,但是我可以在VB.NET中对其进行解释;)

要搜索MS Word的文档,请使用MS Word应用程序中的内置 Find.Execute [ ^ ]方法.
有两种创建MS Word应用程序的方法:
1)使用Interop.Services
2)使用OLE.

在第一种情况下,您需要添加对Interop.Serices的引用并编写如下代码:
You can''t do it in one function!

I can''t help you in ASP.NET, but i can explain it in VB.NET ;)

To search MS Word''s documents use build-in in MS Word application Find.Execute[^] method.
There are two methods to create MS Word application:
1) using Interop.Services
2) using OLE.

In the first case you need to add reference to Interop.Serices and write code like this:
Dim wrdApp = New Word.Application


优点是:客户端的计算机不需要MS Word应用程序.

在第二种情况下,您需要像这样创建MS Word应用程序:


The advantage is: client''s computers does not need MS Word application.

In the second case you need to create MS Word application like this:

Dim wrdApp As Object = Nothing
wrdApp = CreateObject("Word.Application")


现在,您可以访问MS Word中的所有方法和功能;)
这种方法的缺点是需要在客户端计算机上安装MS Word.

详细了解以下内容:早/晚绑定 [


Now you have access to all methods and functions in MS Word ;)
The disadvantage of this approach is the requirement to install MS Word on the client''s computers.

Read more about: early/late bound[^].


这篇关于搜索引擎/功能,可搜索PDF和DOC文档中的所有单词/文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆