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
85 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
3 Comments
 
LVL 48

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 9

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now