Discussion:
VBA change object type back to msoPicture?
(too old to reply)
Gregg
2005-05-16 20:18:02 UTC
Permalink
I have a resize/position/crop routine. In my situation, a user has
selected what is hopefully a graphic in the slide. I need to validate
the selected item is a true graphic, however, for the rest of my
routine to work. For example, I want to be sure the user didn't select
a placeholder by mistake. I don't want to try to resize and crop that.

So, my code checks that the selected item is an msoPicture. Problem is,
as I just learned through Steve, if they inserted the graphic with
AutoCorrect-AutomaticLayout enabled, the graphic becomes an
msoPlaceholder. My code then can no longer tell if they selected the
jpg or a text placeholder. That's not good.

Any strategies to change the graphic back to msoPicture or something
like that?
Hans W. Hofmann
2005-05-17 10:31:32 UTC
Permalink
Post by Gregg
I have a resize/position/crop routine. In my situation, a user has
selected what is hopefully a graphic in the slide. I need to validate
the selected item is a true graphic, however, for the rest of my
routine to work. For example, I want to be sure the user didn't select
a placeholder by mistake. I don't want to try to resize and crop that.
So, my code checks that the selected item is an msoPicture. Problem is,
as I just learned through Steve, if they inserted the graphic with
AutoCorrect-AutomaticLayout enabled, the graphic becomes an
msoPlaceholder. My code then can no longer tell if they selected the
jpg or a text placeholder. That's not good.
Any strategies to change the graphic back to msoPicture or something
like that?
Hm, there for you have to look after

.AutoshapeType = msoShapeMixed
.Type = msoPicture
or
.Type = msoPlaceholder and left(.Name,7)="Picture"

something like that...
HTH
--
Gruß hw
The Powerpoint Community www.ppt-user.de
http://www.ppt-user.de/vba-corner.htm
mail replace .nul to .de
Loading...