# 使用 C++ 檢視或編輯 PPS 中繼資料

> 在 C++ 中檢視和編輯 PPS 中繼資料。使用 Aspose.Slides for C++ 更新簡報的內建屬性與自訂屬性。

Source: https://products.aspose.com/slides/zh-hant/cpp/metadata/pps/
Updated: 2026-10-25



## 透過 C++ 修改 PPS 屬性

透過 Aspose.Slides for C++，無需 Microsoft PowerPoint 即可讀取和更新 PPS 檔案的中繼資料。使用 `Presentation::get_DocumentProperties` 提供的 [`DocumentProperties`](https://reference.aspose.com/slides/cpp/aspose.slides/documentproperties/) 物件變更 `Author` 和 `Title` 等內建屬性，或使用 `idx_set`、`GetCustomPropertyName` 和 `RemoveCustomProperty` 管理自訂屬性。

### 修改 PPS 內建屬性 - C++

```cpp
auto presentation = MakeObject<Presentation>(u"presentation.pps");
auto documentProperties = presentation->get_DocumentProperties();

documentProperties->set_Author(u"New Author");
documentProperties->set_Title(u"New Title");

presentation->Save(u"updated-presentation.pps", SaveFormat::Pps);
presentation->Dispose();
```

### 為 PPS 新增自訂屬性 - C++

```cpp
auto presentation = MakeObject<Presentation>(u"presentation.pps");
auto documentProperties = presentation->get_DocumentProperties();

documentProperties->idx_set(u"Department", ObjectExt::Box<String>(u"Sales"));
documentProperties->idx_set(u"Project", ObjectExt::Box<String>(u"Metadata Update"));
documentProperties->idx_set(u"Revision", ObjectExt::Box<int32_t>(3));

auto customPropertyName = documentProperties->GetCustomPropertyName(2);
documentProperties->RemoveCustomProperty(customPropertyName);

presentation->Save(u"updated-custom-properties.pps", SaveFormat::Pps);
presentation->Dispose();
```

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

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

1. 使用 `Presentation` 類別載入 PPS 檔案。

1. 使用 `get_DocumentProperties` 取得 `DocumentProperties` 物件。

1. 讀取或更新 `Author` 和 `Title` 等內建屬性。

1. 使用 `idx_set`、`GetCustomPropertyName` 和 `RemoveCustomProperty` 新增、讀取或移除自訂屬性。

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

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

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

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