如何在.net core环境下修改文件的属性摘要?比如ApplicationName,谢谢~
抱歉提问有些模糊,是修改上图红框中的这些信息。
第一种方法:
Microsoft.Office.Core.DocumentProperties properties; properties = (Microsoft.Office.Core.DocumentProperties) Globals.ThisDocument.BuiltInDocumentProperties;
properties["Subject"].Value = "Whitepaper";
第二种方法:
Document document = new Document(); document.LoadFromFile(@"..\..\sample.doc");
document.BuiltinDocumentProperties.Title = "Document Demo Document"; document.BuiltinDocumentProperties.Author = "Leo"; document.BuiltinDocumentProperties.Company = "MS";
document.BuiltinDocumentProperties.Keywords = "Document, Property"; document.BuiltinDocumentProperties.Comments = "This document is just a demo.";
document.SaveToFile("result.doc",FileFormat.Doc);