使用vb.net预览文档(就像MS Outlook中的预览窗格一样) [英] Preview Documents (just like Preview Pane in MS Outlook) using vb.net

查看:91
本文介绍了使用vb.net预览文档(就像MS Outlook中的预览窗格一样)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个简单的文档预览器。此应用程序必须预览面板上的任何文件类型(就像ms outlook预览窗格一样)。我的问题是,我在vb.net中使用Web浏览器组件,当我打开MS Office文档时,会弹出一个对话框,要求保存或打开文档。是否有任何其他组件可用于预览我要预览的所有文档?

I am creating a simple document previewer. This application must preview any file type on a panel (just like ms outlook preview pane). My problem is, I am using web browser component in vb.net, when I opened a MS Office document, a dialog box always pop up asking to save or open the document. Is there any other component that may i use to preview all the documents I wish to preview?

推荐答案

当Outlook显示预览时,它会为附加到电子邮件的文件执行此操作因为它已经在本地机器上显示了(你实际上是用电子邮件下载的)...

当你尝试通过网页预览文档时,首先要将文档下载到客户端(本地机器)访问它并做一些预览,这就是Web组件要求您保存或打开的原因...

实际上Web组件与IE浏览器相同的实际情况并使用系统中使用的相同设置IE使用...在系统中,文档可以3种方式打开:

1.文档类型是已知的,并且有一个用于显示的插件 - IE(Web组件)将显示它

2.文档类型已知但没有插件 - IE(Web组件)将为您提供保存或打开e的选项外部应用程序

3.文档类型未知 - IE(Web组件)将为您提供保存它的选项

在所有情况下,整个文档将被下载到您的计算机(本地计算机)几乎不能称为预览...

如果您想提供真实预览,最好在上面创建文档的预览图像服务器端并将其作为图像呈现给用户......
When Outlook displays a preview it does it for files attached to the email and for that are already presented on the local machine (you actually downloaded them with the email)...
When you are try to preview a document via web page you first have to download the document to the client (local machine) to access it and do some preview, that's the reason the web component asks you for save or open...
What actually happening that the web component is the same like your IE browser and use the same settings from the system IE uses...In the system a document can be opened in 3 way:
1. the document type is known and there is a plug-in for display - IE (web component) will display it
2. the document type is known but no plug in - IE (web component) will provide you with the option to save it or open with an external application
3. the document type is unknown - IE (web component) will provide you with the option to save it
In all cases the whole document will be downloaded to your computer (local machine) and it hardly can be called as 'preview'...
If you want to offer a 'real' preview it may be better to create a preview image of the document on the server side and present it to the user as image...


这篇关于使用vb.net预览文档(就像MS Outlook中的预览窗格一样)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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