# 使用 C++ 编辑 ODP 演示文件

> C++ 源代码，用于查找和替换 ODP 演示文稿中的文本。

Source: https://products.aspose.com/slides/zh/cpp/redaction/odp/
Updated: 2023-05-17



## 通过 C++ 编辑 ODP 演示文稿

只需几行代码即可使用 Aspose.Slides for C++ API 搜索和替换内容、评论、幻灯片注释或元数据中的文本。在 PowerPoint 和 OpenOffice 中查找和替换文本。通过正则表达式数据匹配在演示文稿中编辑文本、评论和元数据。

### 使用 C++ 编辑 ODP 演示文稿

```cpp

auto presentation = System::MakeObject<Presentation>(u"welcome-to-powerpoint.odp");

SlideUtil::FindAndReplaceText(presentation, true, u"PowerPoint", u"Aspose.Slides", nullptr);
presentation->Save(u"replaced.odp", SaveFormat::Odp);
```

## 如何通过 C++ 编辑 ODP

这些是编辑 ODP 文件的步骤。

使用 Presentation 实例加载 ODP。

使用 [FindAndReplaceText](https://reference.aspose.com/slides/cpp/aspose.slides.util/slideutil/findandreplacetext/) 方法查找和替换文本。

以 ODP 格式保存结果

## 其他支持的密文格式
