Skip to content

Commit b336f8c

Browse files
Merge pull request #5151 from OfficeDev/main
[Admin] Publish
2 parents d2433bf + 3b3e294 commit b336f8c

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

.openpublishing.publish.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"powerpoint-js-1.5",
5555
"powerpoint-js-1.6",
5656
"powerpoint-js-1.7",
57+
"powerpoint-js-1.8",
5758
"visio-js-1.1",
5859
"word-js-preview",
5960
"word-js-1.1",

docs/powerpoint/bind-shapes-in-presentation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: Bind to shapes in a PowerPoint presentation
33
description: Learn how to bind shapes and access them from your add-in to keep them up to date.
44
ms.topic: how-to
5-
ms.date: 04/02/2025
5+
ms.date: 04/30/2025
66
ms.localizationpriority: medium
77
---
88

9-
# Bind to shapes in a PowerPoint presentation (preview)
9+
# Bind to shapes in a PowerPoint presentation
1010

11-
Your PowerPoint add-in can bind to shapes to consistently access them through an identifier. The add-in establishes a binding by calling `BindingCollection.add` and assigning a unique identifier. Use the identifier at any time to reference the shape and access its properties. Creating bindings provides the following value to your add-in.
11+
Your PowerPoint add-in can bind to shapes to consistently access them through an identifier. The add-in establishes a binding by calling [BindingCollection.add](/javascript/api/powerpoint/powerpoint.bindingcollection#powerpoint-powerpoint-bindingcollection-add-member(1)) and assigning a unique identifier. Use the identifier at any time to reference the shape and access its properties. Creating bindings provides the following value to your add-in.
1212

1313
- Establishes a relationship between the add-in and the shape in the document. Bindings are persisted in the document and can be accessed at a later time.
1414
- Enables access to shape properties to read or update, without requiring the user to select any shapes.
@@ -31,7 +31,7 @@ In a general implementation, there are two components to consider for binding a
3131
3232
## Create a bound shape in PowerPoint
3333

34-
Use the `PowerPoint.BindingsCollection.add()` method for the presentation to create a binding which refers to a particular shape.
34+
Use the `PowerPoint.BindingCollection.add()` method for the presentation to create a binding which refers to a particular shape.
3535

3636
:::image type="content" source="../images/powerpoint-steps-to-bind-shape.png" alt-text="Add-in creates a Base64-encoded image from data source, then creates the shape from the image and adds a unique ID.":::
3737

@@ -58,7 +58,7 @@ await PowerPoint.run(async (context) => {
5858
});
5959
```
6060

61-
Call `BindingsCollection.add` to add the binding to the bindings collection in PowerPoint. The following sample shows how to add a new binding for a shape to the bindings collection.
61+
Call `BindingCollection.add` to add the binding to the bindings collection in PowerPoint. The following sample shows how to add a new binding for a shape to the bindings collection.
6262

6363
```javascript
6464
// Create a binding ID to track the shape for later updates.
@@ -154,7 +154,7 @@ async function getShapeFromBindingID(id) {
154154

155155
## See also
156156

157-
When maintaining freshness on shapes, you may also want to check the zOrder. See the [zOrderPosition](/javascript/api/powerpoint/powerpoint.shape?view=powerpoint-js-preview&preserve-view=true) property for more information.
157+
When maintaining freshness on shapes, you may also want to check the zOrder. See the [zOrderPosition](/javascript/api/powerpoint/powerpoint.shape) property for more information.
158158

159159
- [Work with shapes using the PowerPoint JavaScript API](shapes.md)
160160
- [Bind to regions in a document or spreadsheet](../develop/bind-to-regions-in-a-document-or-spreadsheet.md)

docs/powerpoint/work-with-tables.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
title: Work with tables using the PowerPoint JavaScript API
33
description: Learn how to create tables and control formatting using the PowerPoint JavaScript API.
44
ms.topic: how-to
5-
ms.date: 04/02/2025
5+
ms.date: 04/30/2025
66
ms.localizationpriority: medium
77
---
88

9-
# Work with tables using the PowerPoint JavaScript API (preview)
9+
# Work with tables using the PowerPoint JavaScript API
1010

1111
This article provides code samples that show how to create tables and control formatting by using the PowerPoint JavaScript API.
1212

1313
## Create an empty table
1414

15-
To create an empty table, call the `Shapes.addTable()` method and specify how many rows and columns the table needs. The following code sample shows how to create a table with 3 rows and 4 columns.
15+
To create an empty table, call the [ShapeCollection.addTable()](/javascript/api/powerpoint/powerpoint.shapecollection#powerpoint-powerpoint-shapecollection-addtable-member(1)) method and specify how many rows and columns the table needs. The following code sample shows how to create a table with 3 rows and 4 columns.
1616

1717
```javascript
1818
await PowerPoint.run(async (context) => {
@@ -30,7 +30,7 @@ The previous sample doesn't specify any options, so the table defaults to format
3030

3131
## Specify values
3232

33-
You can populate the table with string values when you create it. To do this provide a 2-dimensional array of values in the `TableAddOptions` object. The following code sample creates a table with string values from "1" to "12". Note the following:
33+
You can populate the table with string values when you create it. To do this provide a 2-dimensional array of values in the [TableAddOptions](/javascript/api/powerpoint/powerpoint.tableaddoptions) object. The following code sample creates a table with string values from "1" to "12". Note the following:
3434

3535
- An empty cell must be specified as an empty string "". If a value is undefined or missing, `addTable` throws an error.
3636
- The outer array contains a list of rows. Each row is an inner array containing a list of string cell values.
@@ -66,13 +66,13 @@ The previous sample creates a table with values as shown in the following image.
6666

6767
## Specify cell formatting
6868

69-
You can specify cell formatting when you create a table, including border style, fill style, font style, horizontal alignment, indent level, and vertical alignment. These formats are specified by the `TableCellProperties` object.
69+
You can specify cell formatting when you create a table, including border style, fill style, font style, horizontal alignment, indent level, and vertical alignment. These formats are specified by the [TableCellProperties](/javascript/api/powerpoint/powerpoint.tablecellproperties) object.
7070

7171
### Uniform cell formatting
7272

7373
Uniform cell formatting applies to the entire table. For example, if you set the uniform font color to white, all table cells will use the white font. Uniform cell formatting is useful for controlling the default formatting you want on the entire table.
7474

75-
Specify uniform cell formatting for the entire table using the `TableAddOptions.uniformCellProperties` property. The following code sample shows how to set all table cells to dark slate blue fill color and bold white font.
75+
Specify uniform cell formatting for the entire table using the [TableAddOptions.uniformCellProperties](/javascript/api/powerpoint/powerpoint.tableaddoptions#powerpoint-powerpoint-tableaddoptions-uniformcellproperties-member) property. The following code sample shows how to set all table cells to dark slate blue fill color and bold white font.
7676

7777
```javascript
7878
const rowCount = 3;
@@ -97,7 +97,7 @@ The previous sample creates a table as shown in the following image.
9797

9898
### Specific cell formatting
9999

100-
Specific cell formatting applies to individual cells and overrides the uniform cell formatting, if any. Set individual cell formatting by using the `TableAddOptions.specificCellProperties` property. The following code sample shows how to set the fill color to black for the cell at row 1, column 1.
100+
Specific cell formatting applies to individual cells and overrides the uniform cell formatting, if any. Set individual cell formatting by using the [TableAddOptions.specificCellProperties](/javascript/api/powerpoint/powerpoint.tableaddoptions#powerpoint-powerpoint-tableaddoptions-specificcellproperties-member) property. The following code sample shows how to set the fill color to black for the cell at row 1, column 1.
101101

102102
Note the `specificCellProperties` must be a 2D array that matches the 2D size of the table exactly. The sample first creates the entire empty 2D array of objects. Then it sets the specific cell format at row 1, column 1, after the options object is created.
103103

@@ -130,7 +130,7 @@ The previous sample creates a table with a specific format applied to the cell i
130130

131131
:::image type="content" source="../images/powerpoint-table-specific-cell-format.png" alt-text="A PowerPoint table with the cell in row 1 column 1 formatted with a black background.":::
132132

133-
The previous sample uses the `font` property which is of type `FontProperties`. The `font` property allows you to specify many properties, such as bold, italic, name, color, and more. The following code sample shows how to specify multiple properties for a font for a cell.
133+
The previous sample uses the [font](/javascript/api/powerpoint/powerpoint.tablecellproperties#powerpoint-powerpoint-tablecellproperties-font-member) property which is of type [FontProperties](/javascript/api/powerpoint/powerpoint.fontproperties). The `font` property allows you to specify many properties, such as bold, italic, name, color, and more. The following code sample shows how to specify multiple properties for a font for a cell.
134134

135135
```javascript
136136
options.specificCellProperties[1][1] = {
@@ -144,7 +144,7 @@ options.specificCellProperties[1][1] = {
144144
};
145145
```
146146

147-
You can also specify a `fill` property which is of type `FillProperties`. The `fill` property can specify a color and the transparency percentage. The following code sample shows how to create a fill for all table cells using the color "light red" and a 50% transparency.
147+
You can also specify a [fill](/javascript/api/powerpoint/powerpoint.tablecellproperties#powerpoint-powerpoint-tablecellproperties-fill-member) property which is of type [FillProperties](/javascript/api/powerpoint/powerpoint.fillproperties). The `fill` property can specify a color and the transparency percentage. The following code sample shows how to create a fill for all table cells using the color "light red" and a 50% transparency.
148148

149149
```javascript
150150
uniformCellProperties: {
@@ -157,7 +157,7 @@ uniformCellProperties: {
157157

158158
## Borders
159159

160-
Use the `TableCellProperties.borders` object to define borders for cells in the table. The following code sample shows how to set the borders of a cell in row 1 by column 1 to a red border with weight 3.
160+
Use the [TableCellProperties.borders](/javascript/api/powerpoint/powerpoint.tablecellproperties#powerpoint-powerpoint-tablecellproperties-borders-member) object to define borders for cells in the table. The following code sample shows how to set the borders of a cell in row 1 by column 1 to a red border with weight 3.
161161

162162
```javascript
163163
const columnCount = 3;
@@ -210,7 +210,7 @@ await insertTableOnCurrentSlide(rowCount, columnCount, options);
210210

211211
## Horizontal and vertical alignment
212212

213-
Use the `TableCellProperties.horizontalAlignment` property to control text alignment in a cell. The following example shows how to set horizontal alignment to left, right, and center for three cells in a table. For a list of all alignment options, see the `ParagraphHorizontalAlignment` enum.
213+
Use the [TableCellProperties.horizontalAlignment](/javascript/api/powerpoint/powerpoint.tablecellproperties#powerpoint-powerpoint-tablecellproperties-horizontalalignment-member) property to control text alignment in a cell. The following example shows how to set horizontal alignment to left, right, and center for three cells in a table. For a list of all alignment options, see the [ParagraphHorizontalAlignment](/javascript/api/powerpoint/powerpoint.paragraphhorizontalalignment) enum.
214214

215215
```javascript
216216
const rowCount = 3;
@@ -267,7 +267,7 @@ The previous sample creates a table with left/top, centered, and right/bottom te
267267

268268
## Specify row and column widths
269269

270-
Specify row and column widths using the `TableAddOptions.rows` and `TableAddOptions.columns` properties. The `rows` property is an array of `TableRowProperties` that you use to set each row’s `rowHeight` property. Similarly, the `columns` property is an array of `TableColumnProperties` you use to set each column’s `columnWidth` property. The width or height is set in points.
270+
Specify row and column widths using the [TableAddOptions.rows](/javascript/api/powerpoint/powerpoint.tableaddoptions#powerpoint-powerpoint-tableaddoptions-rows-member) and [TableAddOptions.columns](/javascript/api/powerpoint/powerpoint.tableaddoptions#powerpoint-powerpoint-tableaddoptions-columns-member) properties. The `rows` property is an array of [TableRowProperties](/javascript/api/powerpoint/powerpoint.tablerowproperties) that you use to set each row's [rowHeight](/javascript/api/powerpoint/powerpoint.tablerowproperties#powerpoint-powerpoint-tablerowproperties-rowheight-member) property. Similarly, the `columns` property is an array of [TableColumnProperties](/javascript/api/powerpoint/powerpoint.tablecolumnproperties) you use to set each column's [columnWidth](/javascript/api/powerpoint/powerpoint.tablecolumnproperties#powerpoint-powerpoint-tablecolumnproperties-columnwidth-member) property. The width or height is set in points.
271271

272272
The height or width that you set may not be honored by PowerPoint if it needs to fit the text. For example, if the text is too wide for a column, PowerPoint will increase the row height so that it can wrap the text to the next line. Similarly, the column width will increase if the specified size is smaller than a single character in the specified font size.
273273

@@ -326,7 +326,7 @@ A merged area is two or more cells combined so that they share a single value an
326326

327327
To specify a merged area, provide the upper left location where the area starts (row, column) and the length of the area in rows and columns. The following diagram shows an example of these values for a merged area that is 3 rows by 2 columns in size. Note that merged areas can't overlap with each other.
328328

329-
Use the `TableAddOptions.mergedAreas` property to specify one or more merged areas. The following code sample shows how to create a table with two merged areas. About the code sample, note the following:
329+
Use the [TableAddOptions.mergedAreas](/javascript/api/powerpoint/powerpoint.tableaddoptions#powerpoint-powerpoint-tableaddoptions-mergedareas-member) property to specify one or more merged areas. The following code sample shows how to create a table with two merged areas. About the code sample, note the following:
330330

331331
- The values property must only specify the value for the upper left corner of the merged area. All other cell values in the merged area must specify empty strings ("").
332332

docs/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,13 @@ items:
909909
displayName: PowerPoint
910910
- name: Work with tables
911911
href: powerpoint/work-with-tables.md
912-
displayName: PowerPoint, preview
912+
displayName: PowerPoint
913913
- name: Work with shapes
914914
href: powerpoint/shapes.md
915915
displayName: PowerPoint
916916
- name: Bind shapes to a data source
917917
href: powerpoint/bind-shapes-in-presentation.md
918-
displayName: PowerPoint, preview
918+
displayName: PowerPoint
919919
- name: Project
920920
items:
921921
- name: Project add-ins documentation

0 commit comments

Comments
 (0)