Sub expandWordOLEs()

'By Kevin Murphy
'kevin.murphy@baselinesinc.com
'2009
'
'This macro will take every embedded Word OLE object in the active document and make
'it inline.
'

Dim objCount As Integer
Dim i As Integer
Dim myObj As InlineShape
Dim rng As Range

ActiveDocument.UndoClear
ActiveWindow.ActivePane.View.Type = wdNormalView
Options.Pagination = False


objCount = ActiveDocument.InlineShapes.Count

'Go to top of document

Selection.GoTo what:=wdGoToPage, which:=wdGoToFirst

i = 1

While i <= objCount
    With ActiveDocument.InlineShapes(i)
        If .Type = wdInlineShapeEmbeddedOLEObject Then
            If .OLEFormat.ProgID = "Word.Document.8" Then
                .OLEFormat.Activate
                ActiveWindow.Document.Range.Select
                Selection.Copy
                ActiveWindow.Close
                .Select
                Selection.Range.Paste
                objCount = ActiveDocument.InlineShapes.Count
                i = i - 1
            End If
        End If
        ActiveDocument.UndoClear
    End With
    i = i + 1
Wend


Options.Pagination = True
ActiveWindow.ActivePane.View.Type = wdPrintView

End Sub