I am creating a macro that converts a Word 2007 document into a structured PowerPoint 2007 presentation. I am looping over all the paragraphs of the document and copying them over to the new presentation.

I am able to copy and paste the paragraphs to the presentation just fine. But I also need to be able to copy and paste the pictures from the Word document into the PowerPoint (and in the right location between paragraphs).

So far, I am able to detect if a paragraph is a picture by looking at the paragraph's style attribute - it will say "Figure". But, I don't know what to do from there. After looking online, it looks like I should be able to do this:

paragraphFromDocument.Range.Copy
currentSlide.Shapes.Paste

But, this doesn't seem to work. How do I copy a picture from Word to PowerPoint?

Thanks

EDIT


I've also tried:

paragraphFromDocument.Range.CopyAsPicture
currentSlide.Shapes.PasteSpecial(ppPasteMetafilePicture)

and get this error message:

Shapes.PasteSpecial : Invalid Request. Clipboard is empty or contains data which may not be posted here.

But, when I use that CopyAsPicture command, I am able to open up PowerPoint (with the picture still on the clipboard from the macro) and use the Paste Special command to paste the picture to the slide.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top