J
John Svendsen
Hi there, I have a macro that copies embedded word tables in PPT to a
WORD document, but with large PPT files I get a Word error "Insufficient
Memory or Disk space. Close extra windows and save your work", but I have a
lot of RAM and disk space. Also, if I try to debug VBA, the 'Set oDoc =
shp.OLEFormat.Object' becomes yellow.
Does anybody have a clue what's going on here? something I
forgot to clean-up in the code? Thanks so much! JS
====================================
Sub CopyPastePPT2Word()
Dim shp As Shape
Dim sld As Slide
Dim wdApp As Word.Application
Dim oDoc As Word.Document
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
If shp.OLEFormat.ProgID = "Word.Document.8" Then
Set oDoc = shp.OLEFormat.Object
oDoc.Select
Selection.Copy
With wdApp
.Selection.Paste
.Selection.TypeParagraph
End With
Set oDoc = Nothing
End If
End If
Next shp
Next sld
End Sub
WORD document, but with large PPT files I get a Word error "Insufficient
Memory or Disk space. Close extra windows and save your work", but I have a
lot of RAM and disk space. Also, if I try to debug VBA, the 'Set oDoc =
shp.OLEFormat.Object' becomes yellow.
Does anybody have a clue what's going on here? something I
forgot to clean-up in the code? Thanks so much! JS
====================================
Sub CopyPastePPT2Word()
Dim shp As Shape
Dim sld As Slide
Dim wdApp As Word.Application
Dim oDoc As Word.Document
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
If shp.OLEFormat.ProgID = "Word.Document.8" Then
Set oDoc = shp.OLEFormat.Object
oDoc.Select
Selection.Copy
With wdApp
.Selection.Paste
.Selection.TypeParagraph
End With
Set oDoc = Nothing
End If
End If
Next shp
Next sld
End Sub