powerpoint package
Classes
PowerPoint.Application | |
PowerPoint.BulletFormat |
Represents the bullet formatting properties of a text that is attached to the PowerPoint.ParagraphFormat. |
PowerPoint.ParagraphFormat |
Represents the paragraph formatting properties of a text that is attached to the PowerPoint.TextRange. |
PowerPoint.Presentation | |
PowerPoint.RequestContext |
The RequestContext object facilitates requests to the PowerPoint application. Since the Office add-in and the PowerPoint application run in two different processes, the request context is required to get access to the PowerPoint object model from the add-in. |
PowerPoint.Shape |
Represents a single shape in the slide. |
PowerPoint.ShapeCollection |
Represents the collection of shapes. |
PowerPoint.ShapeFill |
Represents the fill formatting of a shape object. |
PowerPoint.ShapeFont |
Represents the font attributes, such as font name, font size, and color, for a shape's TextRange object. |
PowerPoint.ShapeLineFormat |
Represents the line formatting for the shape object. For images and geometric shapes, line formatting represents the border of the shape. |
PowerPoint.Slide |
Represents a single slide of a presentation. |
PowerPoint.SlideCollection |
Represents the collection of slides in the presentation. |
PowerPoint.SlideLayout |
Represents the layout of a slide. |
PowerPoint.SlideLayoutCollection |
Represents the collection of layouts provided by the Slide Master for slides. |
PowerPoint.SlideMaster |
Represents the Slide Master of a slide. |
PowerPoint.SlideMasterCollection |
Represents the collection of Slide Masters in the presentation. |
PowerPoint.Tag |
Represents a single tag in the slide. |
PowerPoint.TagCollection |
Represents the collection of tags. |
PowerPoint.TextFrame |
Represents the text frame of a shape object. |
PowerPoint.TextRange |
Contains the text that is attached to a shape, in addition to properties and methods for manipulating the text. |
Interfaces
PowerPoint.AddSlideOptions |
Represents the available options when adding a new slide. |
PowerPoint.InsertSlideOptions |
Represents the available options when inserting slides. |
PowerPoint.Interfaces.BulletFormatData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.BulletFormatLoadOptions |
Represents the bullet formatting properties of a text that is attached to the PowerPoint.ParagraphFormat. |
PowerPoint.Interfaces.BulletFormatUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.CollectionLoadOptions |
Provides ways to load properties of only a subset of members of a collection. |
PowerPoint.Interfaces.HyperlinkCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.HyperlinkCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.HyperlinkData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.HyperlinkUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ParagraphFormatData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ParagraphFormatLoadOptions |
Represents the paragraph formatting properties of a text that is attached to the PowerPoint.TextRange. |
PowerPoint.Interfaces.ParagraphFormatUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.PresentationData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.PresentationLoadOptions | |
PowerPoint.Interfaces.ShapeCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeCollectionLoadOptions |
Represents the collection of shapes. |
PowerPoint.Interfaces.ShapeCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ShapeData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeFillData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeFillLoadOptions |
Represents the fill formatting of a shape object. |
PowerPoint.Interfaces.ShapeFillUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ShapeFontData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeFontLoadOptions |
Represents the font attributes, such as font name, font size, and color, for a shape's TextRange object. |
PowerPoint.Interfaces.ShapeFontUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ShapeLineFormatData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeLineFormatLoadOptions |
Represents the line formatting for the shape object. For images and geometric shapes, line formatting represents the border of the shape. |
PowerPoint.Interfaces.ShapeLineFormatUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ShapeLoadOptions |
Represents a single shape in the slide. |
PowerPoint.Interfaces.ShapeScopedCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.ShapeScopedCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.ShapeUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.SlideCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideCollectionLoadOptions |
Represents the collection of slides in the presentation. |
PowerPoint.Interfaces.SlideCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.SlideData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideLayoutCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideLayoutCollectionLoadOptions |
Represents the collection of layouts provided by the Slide Master for slides. |
PowerPoint.Interfaces.SlideLayoutCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.SlideLayoutData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideLayoutLoadOptions |
Represents the layout of a slide. |
PowerPoint.Interfaces.SlideLoadOptions |
Represents a single slide of a presentation. |
PowerPoint.Interfaces.SlideMasterCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideMasterCollectionLoadOptions |
Represents the collection of Slide Masters in the presentation. |
PowerPoint.Interfaces.SlideMasterCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.SlideMasterData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideMasterLoadOptions |
Represents the Slide Master of a slide. |
PowerPoint.Interfaces.SlideScopedCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.SlideScopedCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.TagCollectionData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.TagCollectionLoadOptions |
Represents the collection of tags. |
PowerPoint.Interfaces.TagCollectionUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.TagData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.TagLoadOptions |
Represents a single tag in the slide. |
PowerPoint.Interfaces.TagUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.TextFrameData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.TextFrameLoadOptions |
Represents the text frame of a shape object. |
PowerPoint.Interfaces.TextFrameUpdateData |
An interface for updating data on the |
PowerPoint.Interfaces.TextRangeData |
An interface describing the data returned by calling |
PowerPoint.Interfaces.TextRangeLoadOptions |
Contains the text that is attached to a shape, in addition to properties and methods for manipulating the text. |
PowerPoint.Interfaces.TextRangeUpdateData |
An interface for updating data on the |
PowerPoint.ShapeAddOptions |
Represents the available options when adding shapes. |
Enums
PowerPoint.ConnectorType |
Specifies the connector type for line shapes. |
PowerPoint.ErrorCodes | |
PowerPoint.GeometricShapeType |
Specifies the shape type for a |
PowerPoint.InsertSlideFormatting |
Specifies the formatting options for when slides are inserted. |
PowerPoint.ParagraphHorizontalAlignment |
Represents the horizontal alignment of the PowerPoint.TextFrame in a PowerPoint.Shape. |
PowerPoint.ShapeAutoSize |
Determines the type of automatic sizing allowed. |
PowerPoint.ShapeFillType |
Specifies a shape's fill type. |
PowerPoint.ShapeFontUnderlineStyle |
The type of underline applied to a font. |
PowerPoint.ShapeLineDashStyle |
Specifies the dash style for a line. |
PowerPoint.ShapeLineStyle |
Specifies the style for a line. |
PowerPoint.ShapeType |
Specifies the type of a shape. |
PowerPoint.TextVerticalAlignment |
Represents the vertical alignment of a PowerPoint.TextFrame in a PowerPoint.Shape. If one the centered options are selected, the contents of the |
Functions
Power |
Creates and opens a new presentation. Optionally, the presentation can be pre-populated with a Base64-encoded .pptx file. |
Power |
Executes a batch script that performs actions on the PowerPoint object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. |
Power |
Executes a batch script that performs actions on the PowerPoint object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. |
Power |
Executes a batch script that performs actions on the PowerPoint object model, using the RequestContext of previously-created API objects. |
Function Details
PowerPoint.createPresentation(base64File)
Creates and opens a new presentation. Optionally, the presentation can be pre-populated with a Base64-encoded .pptx file.
[ API set: PowerPointApi 1.1 ]
export function createPresentation(base64File?: string): Promise<void>;
Parameters
- base64File
-
string
Optional. The Base64-encoded .pptx file. The default value is null.
Returns
Promise<void>
Examples
const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();
reader.onload = (event) => {
// Remove the metadata before the base64-encoded string.
const startIndex = reader.result.toString().indexOf("base64,");
const copyBase64 = reader.result.toString().substr(startIndex + 7);
PowerPoint.createPresentation(copyBase64);
};
// Read in the file as a data URL so we can parse the base64-encoded string.
reader.readAsDataURL(myFile.files[0]);
PowerPoint.run(batch)
Executes a batch script that performs actions on the PowerPoint object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.
export function run<T>(batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
Parameters
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the PowerPoint application. Since the Office add-in and the PowerPoint application run in two different processes, the RequestContext is required to get access to the PowerPoint object model from the add-in.
Returns
PowerPoint.run(object, batch)
Executes a batch script that performs actions on the PowerPoint object model, using the RequestContext of a previously-created API object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.
export function run<T>(object: OfficeExtension.ClientObject, batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
Parameters
- object
- OfficeExtension.ClientObject
A previously-created API object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()".
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the PowerPoint application. Since the Office add-in and the PowerPoint application run in two different processes, the RequestContext is required to get access to the PowerPoint object model from the add-in.
Returns
PowerPoint.run(objects, batch)
Executes a batch script that performs actions on the PowerPoint object model, using the RequestContext of previously-created API objects.
export function run<T>(objects: OfficeExtension.ClientObject[], batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
Parameters
- objects
An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared RequestContext, which means that any changes applied to these objects will be picked up by "context.sync()".
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the PowerPoint application. Since the Office add-in and the PowerPoint application run in two different processes, the RequestContext is required to get access to the PowerPoint object model from the add-in.
Returns
Office Add-ins