# 使用 Python 檢視或編輯 PPT 中繼資料

> 使用 Python 檢視和編輯 PPT 檔案中的內建與自訂中繼資料屬性。

Source: https://products.aspose.com/slides/zh-hant/python-net/metadata/ppt/
Updated: 2026-10-25



## 使用 Python 檢視和修改 PPT 中繼資料

透過 [**Aspose.Slides for Python via .NET**](/slides/zh-hant/python-net/)，可以讀取和更新 PPT 簡報的內建中繼資料，並新增、更新或移除自訂文件屬性。透過 `Presentation.document_properties` 存取 [`IDocumentProperties`](https://reference.aspose.com/slides/python-net/aspose.slides/idocumentproperties/) 物件，修改後將簡報儲存為 PPT 格式。

### 更新 PPT 內建屬性 - Python

```python
with slides.Presentation("presentation.ppt") as presentation:
    document_properties = presentation.document_properties
    document_properties.author = "Aspose.Slides for Python"
    document_properties.title = "Quarterly Review"
    document_properties.subject = "Presentation Metadata"
    document_properties.comments = "Built-in properties updated with Aspose.Slides."
    document_properties.manager = "Project Manager"

    presentation.save("presentation_with_updated_metadata.ppt", slides.export.SaveFormat.PPT)
```

### 新增和移除 PPT 自訂屬性 - Python

```python
with slides.Presentation("presentation.ppt") as presentation:
    document_properties = presentation.document_properties
    document_properties.set_custom_property_value("Department", "Engineering")
    document_properties.set_custom_property_value("Review Count", 3)
    document_properties.set_custom_property_value("Obsolete Status", "Draft")
    document_properties.remove_custom_property("Obsolete Status")

    presentation.save("presentation_with_custom_metadata.ppt", slides.export.SaveFormat.PPT)
```

## 如何使用 Python 編輯 PPT 中繼資料

依照下列步驟編輯 PPT 檔案的中繼資料。

1. 使用 `Presentation` 開啟 PPT 檔案。

1. 透過 `Presentation.document_properties` 存取其 `IDocumentProperties` 物件。

1. 更新內建屬性，或對自訂屬性使用 `set_custom_property_value` 和 `remove_custom_property`。

1. 使用 `Presentation.save` 和 `SaveFormat.PPT` 儲存簡報。

## 線上檢視和編輯 PPT 中繼資料

免費的 Aspose.Slides Metadata 應用程式以 [Aspose.Slides for Python via .NET](https://products.aspose.com/slides/zh-hant/python-net/) 建置，與上方程式碼使用的是同一個 API。開啟它，看看 API 能如何處理您自己的 PPT 檔案。

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

## 其他支援的中繼資料格式
