如何设置某些SpreadsheetDocument属性? [英] How to set certain SpreadsheetDocument Properties?
问题描述
我有当前的Office 365,对于在哪里以及如何设置某些属性有疑问:
PackageProperties.ContentType,
PackageProperties.Identifier,
PackageProperties.Language,
PackageProperties.Revision,
PackageProperties .Version,
因为,我正在写一个WPF桌面C# 应用程序需要设置这些属性才能
识别, 类型,版本和
修订版正在导入的内容。
换句话说,在将内容导入我的应用程序之前,用户需要能够在Excel中设置这些属性。 目的是让他们可以拥有更新的版本和/或内容包含整个内容主题的几个部分。
谢谢!...
代码就像一盒巧克力!...
这些PackageProperties引用如下图所示的属性。您可以使用Office Interop或Open XML库来编写。
请访问
OpenXmlPackage.PackageProperties属性
ContentType基于文件扩展名,请访问
Open XML Documents的内容类型
文件扩展名:
内容类型:
docm
application / vnd.ms-word.document.macroEnabled.12
docx
application / vnd.openxmlformats-officedocument.wordprocessingml.document
dotm
application / vnd.ms-word.template.macroEnabled.12
dotx
application / vnd.openxmlformats-officedocument.wordprocessingml.template
ppsm
application / vnd.ms-powerpoint.slideshow.macroEnabled.12
ppsx
application / vnd.openxmlformats-officedocument.presentationml.slideshow
pptm
application / vnd.ms-powerpoint.presentation.macroEnabled.12
pptx
application / vnd.openxmlformats-officedocument.presentationml.presentation
xlsb
application / vnd.ms-excel.sheet.binary.macroEnabled.12
xlsm
application / vnd.ms-excel.sheet.macroEnabled.12
xlsx
application / vnd.openxmlformats-officedocument.spreadsheetml.sheet
xps
application / vnd.ms-xpsdocument
Hi,
I have the current Office 365 and have a question about where is and how to set certain properties:
PackageProperties.ContentType,
PackageProperties.Identifier,
PackageProperties.Language,
PackageProperties.Revision,
PackageProperties.Version,
because, I'm writing a WPF Desktop C# Application requires these properties to be set in order to identify, type, version and revision of the content being imported.
In other words, the user needs to be able to set these properties in Excel before importing the content into my application. The purpose is so they can have updated editions and/or the content has several parts to the whole content subject.
Thanks!...
Code is like a box of chocolates!...
解决方案Hi,
These PackageProperties refer to the properties shown as picture below. You could use Office Interop or Open XML library to write.
Please visit Workbook.BuiltinDocumentProperties Property and OpenXmlPackage.PackageProperties Property
ContentType is based on file extension, please visit Content Types for Open XML Documents
File Extension:
Content Type:
docm
application/vnd.ms-word.document.macroEnabled.12
docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document
dotm
application/vnd.ms-word.template.macroEnabled.12
dotx
application/vnd.openxmlformats-officedocument.wordprocessingml.template
ppsm
application/vnd.ms-powerpoint.slideshow.macroEnabled.12
ppsx
application/vnd.openxmlformats-officedocument.presentationml.slideshow
pptm
application/vnd.ms-powerpoint.presentation.macroEnabled.12
pptx
application/vnd.openxmlformats-officedocument.presentationml.presentation
xlsb
application/vnd.ms-excel.sheet.binary.macroEnabled.12
xlsm
application/vnd.ms-excel.sheet.macroEnabled.12
xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xps
application/vnd.ms-xpsdocument
这篇关于如何设置某些SpreadsheetDocument属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文