PPT
PPTX
ODP
POT
ppsx
POTX
使用 C# 編輯 POTX 屬性
構建您自己的 .NET 應用程序,以使用服務器端 API 修改演示文稿文件中的內置和自定義屬性。
通過 C# 修改 POTX 屬性
使用 Aspose.Slides for .NET,開發人員可以訪問和修改內置屬性以及自定義屬性的值。開發人員可以使用 Presentation 對象公開的 DocumentProperties 屬性來訪問演示文件的文檔屬性。
修改 POTX 內置屬性 - C#
// Instantiate the Presentation class that represents the Presentation
Presentation presentation = new Presentation("presentation.potx");
// Create a reference to IDocumentProperties object associated with Presentation
IDocumentProperties documentProperties = presentation.DocumentProperties;
// Set the builtin properties
documentProperties.Author = "Aspose.Slides for .NET";
documentProperties.Title = "Modifying Presentation Properties";
documentProperties.Subject = "Aspose Subject";
documentProperties.Comments = "Aspose Description";
documentProperties.Manager = "Aspose Manager";
// Save your presentation to a file
presentation.Save("DocumentProperties_out.potx", SaveFormat.Potx);
將自定義屬性添加到 POTX - C#
// Instantiate the Presentation class
Presentation presentation = new Presentation();
// Getting Document Properties
IDocumentProperties documentProperties = presentation.DocumentProperties;
// Adding Custom properties
documentProperties["New Custom"] = 12;
documentProperties["My Name"] = "Aspose Metadata Editor";
documentProperties["Custom"] = 124;
// Getting property name at particular index
String getPropertyName = documentProperties.GetCustomPropertyName(2);
// Removing selected property
documentProperties.RemoveCustomProperty(getPropertyName);
// Save your presentation to a file
presentation.Save("CustomDocumentProperties_out.potx", SaveFormat.Potx);
如何通過 C# 提取 POTX 的元數據
這些是從 POTX 文件中提取元數據的步驟。
使用 POTX 文件的路徑實例化 Presentation 類
獲取與 Presentation 關聯的 DocumentProperties 對象
遍歷 DocumentProperties 對像中的項目
訪問和修改自定義屬性