VBA change object type back to msoPicture?

G

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?
 
H

Hans W. Hofmann

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top