Aspose.Words如何修改Word文档的标题、作者等信息

作者:控件中国网   出处:控件中国网   2017-01-03 09:54:47   阅读:107

Aspose.Words是目前被广泛应用的一款Word文档处理类控件,在Aspose公司的不断努力下,该产品经过不断的完善和增强,很多功能已经完全适应广大客户的需求,通过该产品开发人员可以在应用程序或者项目中实现Word文件的自由创建、编辑、提取和各种文档之间的转换,Word软件可以实现的功能该产品基本上都可以实现,最主要是所有这些功能都是不需要安装Word软件或者任何第三方插件的情况下实现。在使用Word文档时,很多客户需要把Word文档的一些标题、作者等文档默认属性进行修改,那么利用Aspose.Words可以轻松实现该功能,具体代码如下:
/ The path to the documents directory.
string myDir = GetDataDir_WorkingWithDocument();
// Load the document from disk.
Document doc = new Document(myDir + "Your Document Name.doc");
 
// Modifying Document Title, Subject and Author Name
doc.BuiltInDocumentProperties.Title = "Aspose.Words";
doc.BuiltInDocumentProperties.Subject = "Modifying Document Properties";
doc.BuiltInDocumentProperties.Author = "Jawad Ahmed";
 
// Save the document to disk.
doc.Save("Updated Document Properties.docx");
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat