I want to reshape all selected items in PowerPoint by office-js
.
But all the table's shape.type
are "Unsupported"
and the code below can not change the table width.
async function resizeSelectedShapes() {
await PowerPoint.run(async (context) => {
// First, get the current selection
const selection = context.presentation.getSelectedShapes();
selection.load("items");
const shapeCounts = selection.getCount();
await context.sync();
selection.items.map((shape) => {
shape.load("left,right,width,height");
});
await context.sync();
const rsize = 0.8;
selection.items.map((shape) => {
shape.left *= 0.8;
console.log(shape.type);
shape.width *= 0.8;
if (shape.type == "Image") {
shape.height *= 0.8;
}
});
});
}
I found I can use table in powerpoint web version, so access table in PowerPoint in office-js
is possible or not?