OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
686 stars 95 forks source link

context.presentation.getSelectedShapes(); does not work for slide master or slide layout shapes. #2986

Open oztaskin opened 1 year ago

oztaskin commented 1 year ago

Provide required information needed to triage your issue

The "context.presentation.getSelectedShapes()" method correctly includes all selected shapes on any slide when Normal View is selected from the menu (View / Normal). However, It does not include any selected shape on any slide master, or slide layout when Slide Master view is selected from menu (View / Master / Slide Master).

Your Environment

Expected behavior

This method works as expected when user selects shape(s) on a NormaI view (Menu: View / Normal) of a PowerPoint file. However, it does not work when user selects shape(s) on a Slide Master view (Menu: View / Master / Slide Master). I expected this method to return selected shapes on a slide master or slide layout as well -- unlike the slide.getSelectedShapes() method

Current behavior

Selected Slide Master or Slide Layout shapes are not included -- returned array has zero length.

Steps to reproduce

  1. Create a PowerPoint file, with one Slide and one Slide Layout, add a geometric shape to each.
  2. Install ScriptLab -- if necessary.
  3. Load ScriptLab snippet from https://gist.github.com/oztaskin/e84f0af4a755de6908e14a9787f320ad
  4. In Normal View, select one shape and select ScriptLab's "Shapes Count" button. Console output should report the selected shapes count.
  5. In Slide Master View, select one shape on a slide master or slide layout, and then select ScriptLab's "Shapes Count" button. Console output should report "Selected 0 shapes".

Link to live example(s)




Provide additional details




Context

I am working on a PowerPoint web add-in that needs to identify selected shapes on slides, slide masters and slide layouts.

Useful logs

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

oztaskin commented 1 year ago

Additional context info: I need to extract shape.id and shape.type from selected shapes.

RuizhiSunMS commented 1 year ago

@ononder Please take a look.

oztaskin commented 1 year ago

Would someone please chime-in!

oztaskin commented 1 year ago

@ononder I am still expecting a response...

oztaskin commented 1 year ago

@davidchesnut can you assign this to someone else?

oztaskin commented 1 year ago

Is this site really functioning? Or, is it a joke?

davidchesnut commented 1 year ago

Hi @oztaskin, I apologize for such a slow response. Checking with the team it looks like slide selection with master view is not supported right now. @wangyun-microsoft do you have any additional information on this API?

oztaskin commented 1 year ago

Hi @davidchesnut, Thanks for checking with the team and getting back to me.

This is a critical function for me. Currently, I am supplementing my web add-in with a VBA add-in. Needless to say, that is awkward and limits my add-in to Mac and PC PowerPoint apps. If there is an alternate, and perhaps much more complex solution to this, I would like to know about it.

If there is a forum in which you folks discuss new features, I would like to participate as well.

Best

wangyun-microsoft commented 1 year ago

Hi @oztaskin, thank you for reporting this issue and we can recreate it. We can reproduce this problem with your code provided. I'll provide another update after we have some conclusion later on. Thanks.

oztaskin commented 1 year ago

Hi @wangyun-microsoft, thanks for getting back to me quickly. I am happy to hear that you were able to recreate it. Of course, deciding to fix this defect (or to add this feature) is a different matter. I am pretty sure you folks have other high profile defects to fix and/or features to add as well. I would appreciate if you let me know any developments towards fixing this defect. Best.

oztaskin commented 1 year ago

Hi @wangyun-microsoft,

Any updates on this defect? Best.

wangyun-microsoft commented 1 year ago

Hi @oztaskin, thanks for asking for an update. Unfortunately, we don't have a recent plan to fix this issue. We will update this entry once we start working on it. Thanks.

wangyun-microsoft commented 7 months ago

Change the owner to @EsterBergen .

EsterBergen commented 7 months ago

@oztaskin - Thank you again for providing the input. We're tracking this request to expand functionality to Slide Master. We have an item on our backlog and will update you here once we plan to build this out. Thank you for your patience!

oztaskin commented 7 months ago

Thank you, this is great news...