使用 PowerPoint 确定当前选定的幻灯片 API

Determine currently selected slide using PowerPoint API

我正在使用基于 JS 的 Office Add-ins platform 创建 PowerPoint 插件。

正如 getSelectedSlideIndex() 来自 this sample, it is easy to determine the currently selected slide. Using Office.context.document.getSelectedDataAsync()Office.CoercionType.SlideRange 所证明的那样。

有了幻灯片也可以获得所有包含的形状。例如:

const slide = context.presentation.slides.getItemAt(0);
const shape = slide.shapes.getItemAt(0);

现在我正在寻找一种方法来确定当前选定的形状。 (即用户最后点击的形状。按下 DEL 时将被移除的形状。等等) getSelectedDataAsync() 没有合适的强制转换类型范围。我可以使用其他方法吗?

据我所知,尚不支持获取选定的形状。如果您想申请此功能,请 post 到 Microsoft 365 Developer Platform Ideas Forum