使用 C# 編輯 PPTX 屬性

建置使用伺服器端 API 讀取和修改簡報內建屬性與自訂屬性的 .NET 應用程式。

透過 C# 修改 PPTX 屬性

透過 Aspose.Slides for .NET ,開發人員可以存取和修改簡報的內建屬性與自訂屬性。使用 Presentation 物件的 DocumentProperties 屬性讀取和更新 PPTX 中繼資料。

修改 PPTX 內建屬性 - C#

using var presentation = new Presentation("presentation.pptx");
var documentProperties = presentation.DocumentProperties;

documentProperties.Author = "Aspose.Slides for .NET";
documentProperties.Title = "Modifying Presentation Properties";
documentProperties.Subject = "Aspose Subject";
documentProperties.Comments = "Aspose Description";
documentProperties.Manager = "Aspose Manager";

presentation.Save("DocumentProperties_out.pptx", SaveFormat.Pptx);

為 PPTX 新增自訂屬性 - C#

using var presentation = new Presentation();
var documentProperties = presentation.DocumentProperties;

documentProperties["New Custom"] = 12;
documentProperties["My Name"] = "Aspose Metadata Editor";
documentProperties["Custom"] = 124;

var propertyName = documentProperties.GetCustomPropertyName(2);
documentProperties.RemoveCustomProperty(propertyName);

presentation.Save("CustomDocumentProperties_out.pptx", SaveFormat.Pptx);

如何在 C# 中檢視或編輯 PPTX 中繼資料

依照下列步驟檢視或編輯 PPTX 中繼資料。

  1. 使用 Presentation 載入 PPTX 檔案。
  2. 從簡報取得 DocumentProperties 物件。
  3. 讀取或更新 Author、Title 和 Subject 等內建屬性。
  4. 使用 DocumentProperties 存取和修改自訂屬性。

以 Aspose.Slides 建置

線上檢視和編輯 PPTX 中繼資料

免費的 Aspose.Slides Metadata 應用程式以 Aspose.Slides for .NET 建置,與上方程式碼使用的是同一個 API。開啟它,看看 API 能如何處理您自己的 PPTX 檔案。

  • 在瀏覽器中執行,無需安裝任何軟體。
  • 在撰寫程式碼之前,先看看 Aspose.Slides 如何讀寫屬性。
  • 檢視和編輯 PPTX 檔案的內建屬性與自訂屬性。
  • 儲存並下載更新後的檔案。

其他支援的中繼資料格式

使用 C#,也可以管理下列格式的中繼資料。