powerpoint package

Classes

PowerPoint.Application

[ API set: PowerPointApi 1.0 ]

PowerPoint.BulletFormat

Represents the bullet formatting properties of a text that is attached to the PowerPoint.ParagraphFormat.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ParagraphFormat

Represents the paragraph formatting properties of a text that is attached to the PowerPoint.TextRange.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Presentation

[ API set: PowerPointApi 1.0 ]

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.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeCollection

Represents the collection of shapes.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeFill

Represents the fill formatting of a shape object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeFont

Represents the font attributes, such as font name, font size, and color, for a shape's TextRange object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeLineFormat

Represents the line formatting for the shape object. For images and geometric shapes, line formatting represents the border of the shape.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Slide

Represents a single slide of a presentation.

[ API set: PowerPointApi 1.2 ]

PowerPoint.SlideCollection

Represents the collection of slides in the presentation.

[ API set: PowerPointApi 1.2 ]

PowerPoint.SlideLayout

Represents the layout of a slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.SlideLayoutCollection

Represents the collection of layouts provided by the Slide Master for slides.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.SlideMaster

Represents the Slide Master of a slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.SlideMasterCollection

Represents the collection of Slide Masters in the presentation.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Tag

Represents a single tag in the slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.TagCollection

Represents the collection of tags.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.TextFrame

Represents the text frame of a shape object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.TextRange

Contains the text that is attached to a shape, in addition to properties and methods for manipulating the text.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

Interfaces

PowerPoint.AddSlideOptions

Represents the available options when adding a new slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.InsertSlideOptions

Represents the available options when inserting slides.

[ API set: PowerPointApi 1.2 ]

PowerPoint.Interfaces.BulletFormatData

An interface describing the data returned by calling bulletFormat.toJSON().

PowerPoint.Interfaces.BulletFormatLoadOptions

Represents the bullet formatting properties of a text that is attached to the PowerPoint.ParagraphFormat.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.BulletFormatUpdateData

An interface for updating data on the BulletFormat object, for use in bulletFormat.set({ ... }).

PowerPoint.Interfaces.CollectionLoadOptions

Provides ways to load properties of only a subset of members of a collection.

PowerPoint.Interfaces.ParagraphFormatData

An interface describing the data returned by calling paragraphFormat.toJSON().

PowerPoint.Interfaces.ParagraphFormatLoadOptions

Represents the paragraph formatting properties of a text that is attached to the PowerPoint.TextRange.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ParagraphFormatUpdateData

An interface for updating data on the ParagraphFormat object, for use in paragraphFormat.set({ ... }).

PowerPoint.Interfaces.PresentationData

An interface describing the data returned by calling presentation.toJSON().

PowerPoint.Interfaces.PresentationLoadOptions

[ API set: PowerPointApi 1.0 ]

PowerPoint.Interfaces.ShapeCollectionData

An interface describing the data returned by calling shapeCollection.toJSON().

PowerPoint.Interfaces.ShapeCollectionLoadOptions

Represents the collection of shapes.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ShapeCollectionUpdateData

An interface for updating data on the ShapeCollection object, for use in shapeCollection.set({ ... }).

PowerPoint.Interfaces.ShapeData

An interface describing the data returned by calling shape.toJSON().

PowerPoint.Interfaces.ShapeFillData

An interface describing the data returned by calling shapeFill.toJSON().

PowerPoint.Interfaces.ShapeFillLoadOptions

Represents the fill formatting of a shape object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ShapeFillUpdateData

An interface for updating data on the ShapeFill object, for use in shapeFill.set({ ... }).

PowerPoint.Interfaces.ShapeFontData

An interface describing the data returned by calling shapeFont.toJSON().

PowerPoint.Interfaces.ShapeFontLoadOptions

Represents the font attributes, such as font name, font size, and color, for a shape's TextRange object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ShapeFontUpdateData

An interface for updating data on the ShapeFont object, for use in shapeFont.set({ ... }).

PowerPoint.Interfaces.ShapeLineFormatData

An interface describing the data returned by calling shapeLineFormat.toJSON().

PowerPoint.Interfaces.ShapeLineFormatLoadOptions

Represents the line formatting for the shape object. For images and geometric shapes, line formatting represents the border of the shape.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ShapeLineFormatUpdateData

An interface for updating data on the ShapeLineFormat object, for use in shapeLineFormat.set({ ... }).

PowerPoint.Interfaces.ShapeLoadOptions

Represents a single shape in the slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.ShapeUpdateData

An interface for updating data on the Shape object, for use in shape.set({ ... }).

PowerPoint.Interfaces.SlideCollectionData

An interface describing the data returned by calling slideCollection.toJSON().

PowerPoint.Interfaces.SlideCollectionLoadOptions

Represents the collection of slides in the presentation.

[ API set: PowerPointApi 1.2 ]

PowerPoint.Interfaces.SlideCollectionUpdateData

An interface for updating data on the SlideCollection object, for use in slideCollection.set({ ... }).

PowerPoint.Interfaces.SlideData

An interface describing the data returned by calling slide.toJSON().

PowerPoint.Interfaces.SlideLayoutCollectionData

An interface describing the data returned by calling slideLayoutCollection.toJSON().

PowerPoint.Interfaces.SlideLayoutCollectionLoadOptions

Represents the collection of layouts provided by the Slide Master for slides.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.SlideLayoutCollectionUpdateData

An interface for updating data on the SlideLayoutCollection object, for use in slideLayoutCollection.set({ ... }).

PowerPoint.Interfaces.SlideLayoutData

An interface describing the data returned by calling slideLayout.toJSON().

PowerPoint.Interfaces.SlideLayoutLoadOptions

Represents the layout of a slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.SlideLoadOptions

Represents a single slide of a presentation.

[ API set: PowerPointApi 1.2 ]

PowerPoint.Interfaces.SlideMasterCollectionData

An interface describing the data returned by calling slideMasterCollection.toJSON().

PowerPoint.Interfaces.SlideMasterCollectionLoadOptions

Represents the collection of Slide Masters in the presentation.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.SlideMasterCollectionUpdateData

An interface for updating data on the SlideMasterCollection object, for use in slideMasterCollection.set({ ... }).

PowerPoint.Interfaces.SlideMasterData

An interface describing the data returned by calling slideMaster.toJSON().

PowerPoint.Interfaces.SlideMasterLoadOptions

Represents the Slide Master of a slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.TagCollectionData

An interface describing the data returned by calling tagCollection.toJSON().

PowerPoint.Interfaces.TagCollectionLoadOptions

Represents the collection of tags.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.TagCollectionUpdateData

An interface for updating data on the TagCollection object, for use in tagCollection.set({ ... }).

PowerPoint.Interfaces.TagData

An interface describing the data returned by calling tag.toJSON().

PowerPoint.Interfaces.TagLoadOptions

Represents a single tag in the slide.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.TagUpdateData

An interface for updating data on the Tag object, for use in tag.set({ ... }).

PowerPoint.Interfaces.TextFrameData

An interface describing the data returned by calling textFrame.toJSON().

PowerPoint.Interfaces.TextFrameLoadOptions

Represents the text frame of a shape object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.TextFrameUpdateData

An interface for updating data on the TextFrame object, for use in textFrame.set({ ... }).

PowerPoint.Interfaces.TextRangeData

An interface describing the data returned by calling textRange.toJSON().

PowerPoint.Interfaces.TextRangeLoadOptions

Contains the text that is attached to a shape, in addition to properties and methods for manipulating the text.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.Interfaces.TextRangeUpdateData

An interface for updating data on the TextRange object, for use in textRange.set({ ... }).

PowerPoint.ShapeAddOptions

Represents the available options when adding shapes.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

Enums

PowerPoint.ConnectorType

Specifies the connector type for line shapes.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ErrorCodes
PowerPoint.GeometricShapeType

Specifies the shape type for a GeometricShape object.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.InsertSlideFormatting

Specifies the formatting options for when slides are inserted.

[ API set: PowerPointApi 1.2 ]

PowerPoint.ParagraphHorizontalAlignment

Represents the horizontal alignment of the PowerPoint.TextFrame in a PowerPoint.Shape.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeAutoSize

Determines the type of automatic sizing allowed.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeFillType

Specifies a shape's fill type.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeFontUnderlineStyle

The type of underline applied to a font.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeLineDashStyle

Specifies the dash style for a line.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeLineStyle

Specifies the style for a line.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

PowerPoint.ShapeType

Specifies the type of a shape.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

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 TextFrame will be centered horizontally within the Shape as a group. To change the horizontal alignment of a text, see PowerPoint.ParagraphFormat and PowerPoint.ParagraphHorizontalAlignment.

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

Functions

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 ]

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.

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.

PowerPoint.run(objects, batch)

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

var myFile = document.getElementById("file");
var reader = new FileReader();

reader.onload = function (event) {
    // strip off the metadata before the base64-encoded string
    var startIndex = event.target.result.indexOf("base64,");
    var copyBase64 = event.target.result.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) => Promise<T>): Promise<T>;

Parameters

batch

(context: PowerPoint.RequestContext) => Promise<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

Promise<T>

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) => Promise<T>): Promise<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) => Promise<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

Promise<T>

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) => Promise<T>): Promise<T>;

Parameters

objects

OfficeExtension.ClientObject[]

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) => Promise<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

Promise<T>