# Edit PowerPoint Presentations This guide demonstrates how to edit PPT, PPTX, PPTM, PPSX, PPSM, POTX, POTM presentations with different settings and many other powerful features of GroupDocs.Editor for Python via .NET. > This example demonstrates standard open-edit-save cycle with Presentation documents, using different options on every step. ## Introduction Presentation documents are presented by many formats: PPT, PPTX, PPTM, PPS(X/M), POT(X/M) and other, which are supported by GroupDocs.Editor as a separate format family among all others. Same like for all other family formats, Presentation family has its own load, edit and save options. Presentation format has significant distinction from the WordProcessing and all textual formats, and at the same time big similarity with Spreadsheet formats — it has no pages, but instead of pages it has slides (like Spreadsheet has tabs). Like tabs in Spreadsheets, slides in Presentations are completely separate one from each other and has no valid representation in HTML markup, so the only way to edit slides is to edit them separately, one slide per one editing procedure. As a result, a Presentation document with multiple slides is loaded into the [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor) class. Then, in order to open document for editing by calling an [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor).[edit](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor/edit) method, user should select desired slide for editing by specifying its index in the [PresentationEditOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions). As a result, user will obtain an instance of [EditableDocument](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editabledocument) class, that holds that edited slide. For editing another slide, user should perform another call of the [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor).[edit](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor/edit) method with another slide index, and obtain a new instance of [EditableDocument](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editabledocument) class. Finally, when saving edited slides back to Presentation format, user should save every [EditableDocument](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editabledocument) instance separately. Like all Office OOXML formats, Presentation documents can be encrypted with password. GroupDocs.Editor supports opening password-protected Presentation documents (password should be specified in the [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions)) and creating password-protected documents (password should be specified in the [PresentationSaveOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions)). ## Loading Presentation for editing First step for edit a document is to load it. In order to load presentation to the [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor) class, user should use the [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions) class. It is not necessary in some general cases — even without [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions) the GroupDocs.Editor is able to recognize presentation format and apply appropriate default load options automatically. But when presentation is encoded, the [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions) is the only way to set a password and load the document properly. If document is encoded, but password is not set in the [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions), or [PresentationLoadOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationloadoptions) is not specified at all, then [PasswordRequiredException](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/passwordrequiredexception) exception will be thrown. If password is set, but is incorrect, then [IncorrectPasswordException](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/incorrectpasswordexception) will be thrown. If password is set, but the document is not encoded, then password will be ignored. Below is an example of loading a presentation document from file path with load options and password. ```python from groupdocs.editor import Editor from groupdocs.editor.options import PresentationLoadOptions input_pptx_path = "./presentation.pptx" load_options = PresentationLoadOptions() load_options.password = "password" editor = Editor(input_pptx_path, load_options) ``` ## Edit PowerPoint presentation For opening Presentation document for edit a [PresentationEditOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions) class should be used. It has two properties: [slide_number](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions/slidenumber) of integer type, and a [show_hidden_slides](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions/showhiddenslides), that is a boolean flag. [slide_number](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions/slidenumber) is a zero-based index of a slide, that allows to specify and select one particular slide from a presentation to edit. If lesser then 0, the first slide will be selected (same as *slide_number = 0*). If greater then amount of all slides in presentation, the last slide will be selected. If input presentation contains only single slide, this option will be ignored, and this single slide will be edited. By default is 0, that implies first slide for edit. [show_hidden_slides](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions/showhiddenslides) is a boolean flag, which specifies whether the hidden slides should be included or not. Default is *False* — hidden slides are not shown and exception will be thrown while trying to edit them. So, if input Presentation has 5 slides, where 2nd is hidden, user has specified *slide_number = 1* (2nd slide) and simultaneously *show_hidden_slides = False*, an exception will be thrown. From this short example it can be seen, that the indexes of the hidden slides are not flopped in but instead are _denied_ — when trying to access them, the exception occurs. If parameterless overload of the [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor).[edit](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor/edit) method is used, the default [PresentationEditOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions) instance will be used: first slide and disabled [show_hidden_slides](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationeditoptions/showhiddenslides). Code example below demonstrates all options, described above. Let's assume, that Presentation document with at least 3 slides is already loaded into the [Editor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editor) class. ```python from groupdocs.editor.options import PresentationEditOptions # parameterless overload is used => default PresentationEditOptions is applied, which means 1st slide first_slide = editor.edit() edit_options2 = PresentationEditOptions() edit_options2.slide_number = 1 # index is 0-based, so this is 2nd slide second_slide = editor.edit(edit_options2) edit_options3 = PresentationEditOptions() edit_options3.slide_number = 2 # index is 0-based, so this is 3rd slide edit_options3.show_hidden_slides = True # if 3rd slide is hidden, it will be opened anyway third_slide = editor.edit(edit_options3) ``` ## Save Presentation after edit [PresentationSaveOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions) class is designed for saving the edited Presentation documents. This class has one [constructor](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions/#constructors), which has one parameter — a [Presentation format](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.formats/presentationformats), in which the output document should be saved. This output format is represented by the [PresentationFormats](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.formats/presentationformats) enum. After creating an instance, output format can be obtained or modified later, through the [output_format](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions/outputformat) property. This is the only parameter, which is necessary for saving the document: all others are optional and may be omitted. Along with format, user is able to specify a password through the [password](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions/password) string property — in this case output document will be encoded and protected with this password. By default password is not set, which implies that output document will be unprotected. This is shown in example below, where it is supposed that a user has an [EditableDocument](https://reference.groupdocs.com/editor/python-net/groupdocs.editor/editabledocument) instance with edited slide. ```python from groupdocs.editor.options import PresentationSaveOptions from groupdocs.editor.formats import PresentationFormats save_options = PresentationSaveOptions(PresentationFormats.PPTM) save_options.password = "new password" # saving edited slide to a specified path in PPTM format and with password encoding editor.save(after_edit, output_path, save_options) ``` [PresentationSaveOptions](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions) class contains two properties — [slide_number](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions/slidenumber) and [insert_as_new_slide](https://reference.groupdocs.com/editor/python-net/groupdocs.editor.options/presentationsaveoptions/insertasnewslide) — which are highly coupled together. These properties allow to insert edited slide into existing presentation instead of creating new presentation with single edited slide, which remains the default behavior. They are explained in detail in [separate article]({{< ref "editor/python-net/developer-guide/edit-document/edit-powerpoint/inserting-edited-slide-into-existing-presentation.md" >}}). ## Contents - [Inserting edited slide into existing presentation](https://docs.groupdocs.com/editor/python-net/inserting-edited-slide-into-existing-presentation.md) - [Deleting slides from presentation](https://docs.groupdocs.com/editor/python-net/deleting-slides-from-presentation.md) - [Generating slides preview for presentation](https://docs.groupdocs.com/editor/python-net/generating-slides-preview-for-presentation.md)