Sub Tester()
Dim cDocs As Collection
Dim o As InlineShape
Set cDocs = GetEmbeddedDocs(ActiveDocument)
For Each o In cDocs
o.OLEFormat.Open
With ActiveDocument
.Content.Copy
.Close
End With
o.Select
Selection.Paste
Next o
End Sub
Function GetEmbeddedDocs(oDoc As Word.Document) As Collection
Dim o As InlineShape
Dim c As New Collection
For Each o In oDoc.InlineShapes
If o.Type = wdInlineShapeEmbeddedOLEObject Then
If o.OLEFormat.ProgID Like "Word.Document.*" Then
c.Add o
End If
End If
Next o
Set GetEmbeddedDocs = c
End Function
1 回答
这对我有用(经过轻微测试......)