Reading word tables in powerpoint

J

John Svendsen

Hi All,
I am trying to copy the content of word tables embedded in powerpoint. I've
com up with a VBA code that sort of works (it copies the objects into a word
file one on top of the other - a mess). When I try to use
..Selection.PasteSpecial (instead of Selection.Paste - because I need
unformatted text) VBA compains that "The specified data type is
unavailable". Can someone please give me a clue on what's going on and how
to fix this? Thanks so much!

Sub CopyPasteShape()
Dim shp As Shape
Dim sld As Slide
Dim wdApp As Word.Application
Set wdApp = New Word.Application
With wdApp
.documents.Add
.Visible = True
End With
For Each sld In Application.ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoEmbeddedOLEObject Then
shp.Copy
With wdApp
.Selection.Paste
' This woks but makes a mess, and does not copy unformatted text
.Selection.PasteSpecial Link:=False, DataType:=wdPasteText,
Placement:= _
wdInLine, DisplayAsIcon:=False
' This doesn't work - complains that "specified data type is unavailable"
End With
End If
Next shp
Next sld
End Sub
 

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