# Edit HTML in C++

> Edit HTML files in C++. Use Aspose.Slides for C++ to load HTML content, add text, and save the edited HTML file.

Source: https://products.aspose.com/slides/cpp/editor/html/
Updated: 2026-07-09



## Edit HTML using Aspose.Slides

[**Aspose.Slides for C++**](/slides/cpp/) is a C++ API for working with presentation content and related formats. You can load an `HTML` file into a `Presentation`, add text to a slide, and save the result as `HTML`.

## Edit HTML in C++

Using [**Aspose.Slides for C++**](/slides/cpp/), you can edit an `HTML` file by importing it with `AddFromHtml`, adding a text shape, and saving the result with `SaveFormat::Html5`.

### C++ code for editing HTML

```cpp
auto htmlText = File::ReadAllText(u"page.html");
auto presentation = MakeObject<Presentation>();

presentation->get_Slides()->RemoveAt(0);
presentation->get_Slides()->AddFromHtml(htmlText);

auto slide = presentation->get_Slide(0);
auto textBox = slide->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 10, 10, 100, 50);
textBox->get_TextFrame()->set_Text(u"New text");

presentation->Save(u"page.html", SaveFormat::Html5);
presentation->Dispose();
```

## How to edit HTML in C++

Install **Aspose.Slides for C++**. See [**Installation**](https://docs.aspose.com/slides/cpp/installation/).

Add the library as a reference in your project.

Read the `HTML` file content with `File::ReadAllText`.

Create a `Presentation` instance and load the `HTML` content with `AddFromHtml`.

Add a text shape with `AddAutoShape` and `set_Text`.

Save the edited file with `SaveFormat::Html5`.

## Edit other files
