在浏览器中以 HTML 形式查看 MS Word
你好 正在开发一种小型搜索引擎类型的应用程序。它搜索Word文档中的内容。我需要像 gmail 中那样实现“以 html 形式查看”选项。当我单击该文档的链接时,它应该在新浏览器中以 html 页面的形式打开。有什么办法可以实现这一点吗?
我能够在 iframe 中打开 word doc,但这不符合我的目的。
我的应用程序使用 Asp.Net 和 C#。任何帮助将不胜感激。
问候
维涅什
Hi
Am developing a small search engine kind of application. It searches for contents in word documents. I need to implement a "view as html" option as in gmail. When I click the link to the doc, it should open as a html page in a new browser. Is there any way to achieve this?
I was able to open the word doc in an iframe, but that does not suit my purpose.
My application uses Asp.Net and C#. Any help would be appreciated.
Regards
Vignesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单、缓慢、内存密集、不可扩展、不可扩展(需要说两遍)的方法是使用 Office COM API 加载文件并将其另存为 html(或实际上是文本,因为您想做的所有事情)是对它的搜索),但我真的怀疑你是否可以在一个适度使用的网站上实现这一点。
抛开这一点,您只能使用开源解析器或使用
IFilter
接口来完成此操作。我找到了后者的一个例子: http://www.neowin.net/forum/topic/316480-reading-text-from-ms-word-files-in-cThe easy, slow, memory-intensive, unscalable, unscalable (needs to be said twice) way of doing it would be to use the office COM API to load the file and save it as html (or text actually since all you want to do is a search on it), but I really doubt you can pull this off in even a moderately used web site.
Throwing that aside, you're left with open source parsers or using the
IFilter
interface to do it. I found an example of the latter: http://www.neowin.net/forum/topic/316480-reading-text-from-ms-word-files-in-c