Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting a Slide Zoom in PowerPoint 2016 using vba

Tags:

powerpoint

vba

PowerPoint 2016 has a neat new feature where you can insert Zoom Slides/Sections. See here if you don't know what I'm talking about: https://support.office.com/en-us/article/Use-Zoom-for-PowerPoint-to-bring-your-presentation-to-life-9d6c58cd-2125-4d29-86b1-0097c7dc47d7

I'm trying to automate this process since I use this feature 20-30 times per presentation. For visibility, the workflow I want to automate is the following:

  1. Take screenshot of application/screen
  2. Insert new, blank slide in PowerPoint
  3. Paste screenshot in slide and adjust size/position
  4. Hide the new slide
  5. Insert the screenshot-slide as a Slide Zoom in another slide

I've got steps 1-4 in a VBA macro already, but I can't figure out if there's a vba command to insert a Slide Zoom. My fear is that since this feature is new to 2016 then it's not in VBA yet.

Anyone knows a VBA command line to automate step 5 above?

Thanks in advance!

Vincent

like image 538
Vincent Courtemanche Avatar asked Mar 10 '23 08:03

Vincent Courtemanche


2 Answers

There doesn't seem to be anything in the object model (at least as seen by VBA) that would help with this. Shapes and ShapeRanges now have a HasSectionZoom property, but this returns false, even for shapes that have been inserted using the Zoom | Section Zoom feature.

Alt NY2C will at least get you to the Insert Section Zoom dialog box quickly.

like image 73
Steve Rindsberg Avatar answered Apr 02 '23 14:04

Steve Rindsberg


I've just come across a need for this and the HasSectionZoom property is still not returning the expected result nor is there anything new in the OM in PowerPoint 2016 Insider version 1809, build 10813.20004 to aid in the automation of zoom content creation. But in addition to Steve's key stroke method for opening the Insert Section Zoom dialog, you can use these methods to do the same:

Application.CommandBars.ExecuteMso "MSPPTInsertTableofContents"
Application.CommandBars.ExecuteMso "SectionZoomInsert"
Application.CommandBars.ExecuteMso "SlideZoomInsert"

I just love the way the idMSO control names are nice and consistent ;-)

like image 44
Jamie Garroch - MVP Avatar answered Apr 02 '23 13:04

Jamie Garroch - MVP