PowerPoint.Presentation
Description
A class for creating, opening, and editing PowerPoint presentations.
Properties
slides | Accesses slides in the presentation (Read Only). |
slideSize | Gets/sets the size of the slides in the presentation. |
slideSizeType | Gets/sets the SlideSizeType of the presentation, an enumeration of PowerPoint.SlideSizeType. |
template | The template the presentation is using (Read Only). |
Methods
addSlide | Adds a slide with a specific layout. |
applyTemplate | Applies a Template from a file. |
applyTheme | Applies a theme from a file. |
close | Closes the presentation and quits the current PowerPoint instance. |
create | Create a new empty presentation. |
open | Opens a presentation from a given path. |
save | Saves the presentation. |
Details
PowerPoint.Presentation.slides
readonly PowerPoint.Slide slides
Description
Accesses slides in the presentation (Read Only).
Accessing the Number of slides in the presentation
You can access the number of slides in the presentation with the following code.
presentation.slides.length
Accessing slides by Rank
You can access an individual slide with the following code.
presentation.slides[1] // first slide
presentation.slides[presentation.slides.length] // last slide
presentation.slides[i] // i-th slide
PowerPoint.Presentation.slideSize
Vec2 slideSize
Description
Gets/sets the size of the slides in the presentation.
PowerPoint.Presentation presentation;
presentation.create(1);
presentation.addSlide(PowerPoint.Layout.blank);
presentation.slideSize = Vec2(400,400);
return presentation.slideSize;
PowerPoint.Presentation.slideSizeType
int slideSizeType
Description
Gets/sets the SlideSizeType of the presentation, an enumeration of PowerPoint.SlideSizeType.
PowerPoint.Presentation presentation;
presentation.create(1);
presentation.addSlide(PowerPoint.Layout.blank);
presentation.slideSizeType = PowerPoint.SlideSizeType.OnScreen16x10;
return presentation.slideSizeType;
PowerPoint.Presentation.template
readonly string template
Description
The template the presentation is using (Read Only).
PowerPoint.Presentation presentation;
presentation.open(modeldir() + "\\Presentation.pptx", 1);
return presentation.template;
PowerPoint.Presentation.addSlide()
void addSlide( int layout ) |
Parameters
layout | The layout you want to apply to the slide when it is added. This should be an enumeration of PowerPoint.Layout. |
Description
Adds a slide with a specific layout.
PowerPoint.Presentation presentation;
presentation.create(1);
presentation.addSlide(PowerPoint.Layout.blank);
PowerPoint.Presentation.applyTemplate()
void applyTemplate( string filePath ) |
Parameters
filePath | The path to where the theme is. |
Description
Applies a Template from a file.
PowerPoint.Presentation presentation;
presentation.applyTemplate(modeldir() + "\\Template.potx");
PowerPoint.Presentation.applyTheme()
void applyTheme( string filePath ) |
Parameters
filePath | The path to where the theme is. |
Description
Applies a theme from a file.
PowerPoint.Presentation presentation;
presentation.applyTheme(modeldir() + "\\Theme.thmx");
PowerPoint.Presentation.close()
void close( ) |
Description
Closes the presentation and quits the current PowerPoint instance.
PowerPoint.Presentation presentation;
presentation.create(1);
presentation.save(modeldir() + "\\Presentation.pptx");
presentation.close();
PowerPoint.Presentation.create()
void create( int visible ) |
Parameters
visible | Have the created presentation visible to the user or not. |
Description
Create a new empty presentation.
PowerPoint.Presentation presentation;
presentation.create(1);
PowerPoint.Presentation.open()
void open( string filePath , int visible ) |
Parameters
filePath | The path to the PowerPoint presentation you want to open. |
visible | Have the opened presentation visible to the user or not. |
Description
Opens a presentation from a given path.
PowerPoint.Presentation presentation;
presentation.open(modeldir() + "\\Presentation.pptx", 1);
PowerPoint.Presentation.save()
void save( string filePath = 0 ) |
Parameters
filePath | The path to where you want to save the presentation. If not specified, then it will save over the file path the presentation was opened from or previously saved to. |
Description
Saves the presentation.
PowerPoint.Presentation presentation;
presentation.save(modeldir() + "\\Presentation.pptx");