[PowerPoint javascript API] Insert an image to a slide without switching to it

[PowerPoint javascript API] Insert an image to a slide without switching to it
4

Upvotes

Upvote

 Sep 21 2023
0 Comments 
New

Currently we are using Office.context.document.setSelectedDataAsync to insert an image into a slide, however this way, we can upload an image only to the currently selected slide so we also need to run Office.context.document.goToByIdAsync(slideId, Office.GoToType.Slide) in order to switch to this slide first.

 

Would it possible to insert an image to a slide with given number without the need of switching to this slide?

 

use case: User imports few images to the slide 1 using our add-in, this proces may take up to a few minutes (depending on the number of importing images and it’s size), during this process user wants to do some changes on slide 2, however in the current workflow he needs to wait for an import process to finish, other way the images would be inserted into wrong slide