detect imported pictures vs. non-imported pictures

G

Guest

Is there a way to have my code tell if a given shape in a file is an imported
picture? Right now I see no way to do this.

Ultimately I want to convert each imported picture to a drawing object, but
I'd like to do it with code rather than have users manually click through an
entire file to see whether it is or isn't an imported picture.

I can loop through each slide in the file, and each shape on each slide, but
I don't see any way to tell me if a given shape is an imported picture.

Thanks.
 
B

Bill Dilworth

an imported picture as opposed to what? All pictures are either imported or
linked.

Do you mean an OLE object as opposed to a picture?


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
G

Guest

Not sure as opposed to what. However, a bit of additional info:

In a given PowerPoint file, I can click on some of the shapes in the file,
then click on "Draw" on the Drawing Toolbar, then select "Ungroup." The
objects ungroup.

Other shapes I do the same thing to, but before the objects will ungroup, I
get a dialog stating "This is an imported object, not a group. If you convert
it to a Microsoft drawing object..."

For the latter shapes (the ones where I get the dialog), I'm trying to
figure out if there's a way I can search for them and convert them
programatically, rather than make a user do it manually.

If I loop through all the objects on a slide and look at the Shape.Type
property, there doesn't seem to be any way for me to tell whether a shape is
an imported object or not. But perhaps there's a different way to do it?

Also forgot to note that I'm running PowerPoint 2003, Windows XP with SP2.

Thanks.
 
S

Steve Rindsberg

Tony Logan said:
Not sure as opposed to what. However, a bit of additional info:

In a given PowerPoint file, I can click on some of the shapes in the file,
then click on "Draw" on the Drawing Toolbar, then select "Ungroup." The
objects ungroup.

Other shapes I do the same thing to, but before the objects will ungroup, I
get a dialog stating "This is an imported object, not a group. If you convert
it to a Microsoft drawing object..."

You may get that message from several different object types:

- Embedded or Linked Picture objects if they're vector graphics (WMFs, EMFs,
sometimes EPS, which some versions of PPT will -- stupidly -- let you ungroup).
Embedded pictures that are pure raster formats don't allow ungrouping at all.

- Embedded OLE objects, Linked OLE objects
For the latter shapes (the ones where I get the dialog), I'm trying to
figure out if there's a way I can search for them and convert them
programatically, rather than make a user do it manually.

Fundamentally, you cycle through the shapes, check each shape's .Type and if it's
7, 10, 11 or 13 you attempt to ungroup it.

With oShape
Select Case .Type
Case 7,10,11,13
On Error Resume Next
.Ungroup
If Err.Num <> 0 Then
Debug.Print "Oopsie on Shape " & .Name
End If
Case Else
' let it be
End Select
End With
 

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