powerpoint文档的属性通常包括标题、主题、标记、作者、公司等信息。恰当的文档属性可以帮助读者快速了解文档所要传递的信息。本文将介绍如何使用spire.presenation为powerpoint文档设置文档属性以及获取现有powerpoint文档的属性。
设置文档属性
c#
//创建ppt文档
presentation ppt = new presentation();
//设置文档属性
ppt.documentproperty.title = "怎样使用spire.presentation设置文档属性";
ppt.documentproperty.subject = "无";
ppt.documentproperty.author = "spire.presentation";
ppt.documentproperty.manager = "bill";
ppt.documentproperty.company = "成都冰蓝科技有限公司";
ppt.documentproperty.category = "示例文档";
ppt.documentproperty.keywords = "powerpoint文档属性";
ppt.documentproperty.comments = "更多详情,请访问https://www.e-iceblue.com/";
//保存文档
ppt.savetofile("设置文档属性.pptx", fileformat.pptx2013);
vb.net
'创建ppt文档
dim ppt as new presentation()
'设置文档属性
ppt.documentproperty.title = "怎样使用spire.presentation设置文档属性"
ppt.documentproperty.subject = "无"
ppt.documentproperty.author = "spire.presentation"
ppt.documentproperty.manager = "bill"
ppt.documentproperty.company = "成都冰蓝科技有限公司"
ppt.documentproperty.category = "示例文档"
ppt.documentproperty.keywords = "powerpoint文档属性"
ppt.documentproperty.comments = "更多详情,请访问https://www.e-iceblue.com/"
'保存文档
ppt.savetofile("设置文档属性.pptx", fileformat.pptx2013)
获取文档属性
c#
//加载现有ppt文档
presentation ppt = new presentation();
ppt.loadfromfile("设置文档属性.pptx");
//获取文档属性
console.writeline("标题: " ppt.documentproperty.title);
console.writeline("主题: " ppt.documentproperty.subject);
console.writeline("作者: " ppt.documentproperty.author);
console.writeline("管理者: " ppt.documentproperty.manager);
console.writeline("公司: " ppt.documentproperty.company);
console.writeline("类别: " ppt.documentproperty.category);
console.writeline("标记: " ppt.documentproperty.keywords);
console.writeline("备注: " ppt.documentproperty.comments);
console.readkey();
vb.net
'加载现有ppt文档
dim ppt as new presentation()
ppt.loadfromfile("设置文档属性.pptx")
'获取文档属性
console.writeline("标题: " ppt.documentproperty.title)
console.writeline("主题: " ppt.documentproperty.subject)
console.writeline("作者: " ppt.documentproperty.author)
console.writeline("管理者: " ppt.documentproperty.manager)
console.writeline("公司: " ppt.documentproperty.company)
console.writeline("类别: " ppt.documentproperty.category)
console.writeline("标记: " ppt.documentproperty.keywords)
console.writeline("备注: " ppt.documentproperty.comments)
console.readkey()