how do I convert an imported object to a drawing object?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here's what I'm doing: from Word, I open a PowerPoint file, cycle through
each slide, cycle through each shape, and extract the text within the various
shapes.

Most of this code I adapted from the PPTools site (this page in particular:
http://www.pptfaq.com/FAQ00594.htm), which has a pile of great help, in case
you haven't checked it out.

I'm getting a "Permission denied" error in my code, though, as soon as I
encounter a shape that contains data linked to an external file (an embedded
Excel file placed inside an AutoShape, in this case).

There's info in the PowerPoint help file on how to do this manually. I'm
wondering if there's a way to handle it programmatically.

Here's the info from the Help file:

= = = = = = =
Edit an embedded object without its source program

If an embedded object's source program is unavailable, you can convert it to
a Microsoft Office drawing object to edit. After you convert an embedded
object to an Office drawing object, it is no longer connected to the original
program.

1. Select the embedded object you want to convert to an Office drawing
object and edit.
2. On the Drawing toolbar, click Draw, and then click Ungroup.
3. In the alert message that appears, click Yes.
4. On the Drawing toolbar, click Draw, and then click Group.
= = = = = = =

Anyone know of a way to perform the above steps with code? I've tried
recording a macro, but it doesn't seem to include any way of handling the
dialog box that pops up asking me if I want to convert the shape to a drawing
object.

Thanks.
 
Tony Logan said:
Here's what I'm doing: from Word, I open a PowerPoint file, cycle through
each slide, cycle through each shape, and extract the text within the various
shapes.

Most of this code I adapted from the PPTools site (this page in particular:
http://www.pptfaq.com/FAQ00594.htm), which has a pile of great help, in case
you haven't checked it out.

I'm getting a "Permission denied" error in my code, though, as soon as I
encounter a shape that contains data linked to an external file (an embedded
Excel file placed inside an AutoShape, in this case).

How did you place an Excel file inside an AutoShape?

But in any case, PowerPoint has no idea what's in the embedded Excel object. To
get at the text in it, you'd need to activate the object and automate Excel as
well.

Or, following the instrux you quoted, you could ungroup the object first (to
turn it into MS/PPT drawing objects. But after that it'd no longer be an Excel
object. If you're working on a copy of the presentation rather than the
original, that shouldn't matter, and might be the simplest way to proceed.

I'd first make a pass through the presentation testing each shape to see if it's
an embedded ole object and ungrouping it if so. Then make a second pass to grab
all the text.
 
Back
Top