Solved

Why does applying shadow to a group of PowerPoint shapes programmatically with VBA apply it to the group items?

Posted on 2016-09-09
3
156 Views
Last Modified: 2016-09-12
I'm using PowerPoint 2016 (PC) to add two standard rectangles to a slide via the UI.

If I group them, select the groups and then add the preset shadow type type Perspective Upper Left, I get this result:

Shadow applied to a group of shapes via PowerPoint UI
If I then open the VBE and query the shadow type with:

?ActiveWindow.Selection.ShapeRange(1).Shadow.Type

Open in new window


I get 39 which equates to the enumeration constant msoShadow39

With the group selected, if I now set the shadow to none and try to apply it programatically with this:

ActiveWindow.Selection.ShapeRange(1).Shadow.Type=msoShadow39

Open in new window


I get a result which is equivalent to applying the shadow separately to each of the shapes within the group rather than the group as a whole and this is confirmed when looking at the shape properties in the PowerPoint UI:

Shadow applied to a group of shapes via PowerPoint VBA
Why is this happening?
0
Comment
Question by:Jamie Garroch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 41791211
Hi,

I cannot say why but the only workaround that I see is to group the shapes, cut the group and paste it at the same position as a picture before using the shadow.

it seems that vba recognize the children and like if you were selecting the group and the individual shapes too, you would get the wrong result as well.

Regards
0
 
LVL 23

Assisted Solution

by:JSRWilson
JSRWilson earned 250 total points
ID: 41791516
Why? Who can see into the minds of MSFT programmers. I can tell you though that it has always been that way so if it is a bug I doubt it will be fixed anytime soon.

If you copy and paste the group as an EMF you will get the first result with code (useless info)
0
 
LVL 12

Author Comment

by:Jamie Garroch
ID: 41793837
Thanks guys. FYI, I was "playing" around with a 3D automation idea and the original example above is an overly simplified extract of what I was trying to achieve to demo the issue I was facing. This video illustrates why I needed to keep the original PowerPoint shapes and not convert them:
https://www.dropbox.com/s/skw90gocd1fztwv/3D%20arc%20spiral.mp4?dl=0
Oh well, another idea in the trash thanks to buggy VBA!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question