JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
512 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm developing a Add-in for PowerPoint that inserts images in the document.
I'm currently able to insert the image, but what I'm not able to do is to replace a current selected image.
So, for example, imagine that
But I'm not able to get his selection with the Office API.
Can someone help me?
My current code is like this:
const insertFile = (binaryStr: string) => {
const dataOptions = {
coercionType: Office.CoercionType.Image,
};
Office.context.document.setSelectedDataAsync(binaryStr, dataOptions, (result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.error(result.error.message);
}
});
};
Hi @Samuel Monteiro ,
Since your issues are about development codes, it is recommended that you click on the link: PowerPoint add-ins developer community to post issues.
Besides, I will modify the tag "office-powerpoint-itpro" to be "office-js-dev", as we handle the general issues of PowerPoint desktop client.
Thanks for your understanding.