如何使用ASP.NET代码查找word文件的所有属性 [英] How to find all properties of a word file using ASP.NET code

查看:86
本文介绍了如何使用ASP.NET代码查找word文件的所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how to find all properties of a word file using asp.net code(like details,prev version,security,fileseclore etc).specially I want to see the property shown as different tab when we right click on a work file





我尝试过:



使用了FileInfo对象但所有属性都无法访问。



What I have tried:

FileInfo object used but all properties not able to access.

推荐答案

在Google中搜索并找到以下内容可能有所帮助。

如何:读取和写入文档属性 [ ^ ]

文档属性(Microsoft.Office.Interop.Word) [ ^ ]



希望,它有帮助:)
Searched in Google and found following which may help.
How to: Read from and Write to Document Properties[^]
Document properties (Microsoft.Office.Interop.Word)[^]

Hope, it helps :)


如果你只是查看Word 2007文件( *。docx ),然后 DocX [< a href =https://github.com/xceedsoftware/DocX\"target =_ blanktitle =新窗口> ^ ]可以阅读它们。



(它是商业产品的免费和开源版本,但到目前为止唯一的区别是它没有支持,免费版本无法转换为PDF。)



或者,您可以使用OpenXML SDK:

使用Open XML SDK 2.0从Word 2010文档中检索自定义属性。 [ ^ ]



为了支持旧的文件格式( * .doc ),那里这是Microsoft提供的一种古老工具:

下载Microsoft Developer从官方Microsoft下载中心支持OLE文件属性读取器2.1示例(KB 224351) [ ^ ]

但是,考虑到年龄,不能保证它仍然有效。



注意:您不能使用ASP.NET的Office Interop:

If you're only looking at Word 2007 files (*.docx), then DocX[^] can read them.

(It's a free and open-source version of a commercial product, but so far the only differences are that it doesn't come with support, and the free version can't convert to PDF.)

Alternatively, you can use the OpenXML SDK:
Retrieving Custom Properties from Word 2010 Documents by Using the Open XML SDK 2.0.[^]

To support the older file format (*.doc), there's an ancient tool available from Microsoft:
Download Microsoft Developer Support OLE File Property Reader 2.1 Sample (KB 224351) from Official Microsoft Download Center[^]
However, given the age, there's no guarantee it will still work.

NB: You can't use Office Interop from ASP.NET:

Microsoft目前不建议也不支持从任何无人参与的非交互式客户端应用程序自动化Microsoft Office应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务),因为Office在此环境中运行时可能会出现不稳定的行为和/或死锁。

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.


这篇关于如何使用ASP.NET代码查找word文件的所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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