What's new in PowerPoint JavaScript API 1.4

PowerPointApi 1.4 added additional support for management of shapes.

The first table provides a concise summary of the APIs, while the subsequent table gives a detailed list.

Feature area Description Relevant objects
Shape management Adds support for adding, moving, sizing, formatting, and removing shapes. ShapeFill
ShapeFont
ShapeLineFormat

API list

The following table lists the PowerPoint JavaScript API requirement set 1.4. For a complete list of all PowerPoint JavaScript APIs (including preview APIs and previously released APIs), see all PowerPoint JavaScript APIs.

Class Fields Description
BulletFormat visible Specifies if the bullets in the paragraph are visible.
ParagraphFormat bulletFormat Represents the bullet format of the paragraph.
horizontalAlignment Represents the horizontal alignment of the paragraph.
Shape fill Returns the fill formatting of this shape.
height Specifies the height, in points, of the shape.
left The distance, in points, from the left side of the shape to the left side of the slide.
lineFormat Returns the line formatting of this shape.
name Specifies the name of this shape.
textFrame Returns the text frame object of this shape.
top The distance, in points, from the top edge of the shape to the top edge of the slide.
type Returns the type of this shape.
width Specifies the width, in points, of the shape.
ShapeAddOptions height Specifies the height, in points, of the shape.
left Specifies the distance, in points, from the left side of the shape to the left side of the slide.
top Specifies the distance, in points, from the top edge of the shape to the top edge of the slide.
width Specifies the width, in points, of the shape.
ShapeCollection addGeometricShape(geometricShapeType: PowerPoint.GeometricShapeType, options?: PowerPoint.ShapeAddOptions) Adds a geometric shape to the slide.
addLine(connectorType?: PowerPoint.ConnectorType, options?: PowerPoint.ShapeAddOptions) Adds a line to the slide.
addTextBox(text: string, options?: PowerPoint.ShapeAddOptions) Adds a text box to the slide with the provided text as the content.
ShapeFill clear() Clears the fill formatting of this shape.
foregroundColor Represents the shape fill foreground color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange").
setSolidColor(color: string) Sets the fill formatting of the shape to a uniform color.
transparency Specifies the transparency percentage of the fill as a value from 0.0 (opaque) through 1.0 (clear).
type Returns the fill type of the shape.
ShapeFont bold Represents the bold status of font.
color HTML color code representation of the text color (e.g., "#FF0000" represents red).
italic Represents the italic status of font.
name Represents font name (e.g., "Calibri").
size Represents font size in points (e.g., 11).
underline Type of underline applied to the font.
ShapeLineFormat color Represents the line color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange").
dashStyle Represents the dash style of the line.
style Represents the line style of the shape.
transparency Specifies the transparency percentage of the line as a value from 0.0 (opaque) through 1.0 (clear).
visible Specifies if the line formatting of a shape element is visible.
weight Represents the weight of the line, in points.
TextFrame autoSizeSetting The automatic sizing settings for the text frame.
bottomMargin Represents the bottom margin, in points, of the text frame.
deleteText() Deletes all the text in the text frame.
hasText Specifies if the text frame contains text.
leftMargin Represents the left margin, in points, of the text frame.
rightMargin Represents the right margin, in points, of the text frame.
textRange Represents the text that is attached to a shape in the text frame, and properties and methods for manipulating the text.
topMargin Represents the top margin, in points, of the text frame.
verticalAlignment Represents the vertical alignment of the text frame.
wordWrap Determines whether lines break automatically to fit text inside the shape.
TextRange font Returns a ShapeFont object that represents the font attributes for the text range.
getSubstring(start: number, length?: number) Returns a TextRange object for the substring in the given range.
paragraphFormat Represents the paragraph format of the text range.
text Represents the plain text content of the text range.

See also