Question: I want to write a macro which converts all the shapes and pictures in my word document to inline with text. 
 The code that I am using converts all shapes(which are edited by drawing tools) to inline with text, but the table which are previously converted to pictures(edited by picture tools) or any other pictures are not text wrapping it to inline with text. Pasting the code I am using

```
For Each oShp In ActiveDocument.Shapes
   oShp.Select
   Selection.ShapeRange.WrapFormat.Type = wdWrapInline
Next oShp

```

Answer: 
The first answer was a good start but there is a problem. For Each iterates over the collection but the collection is changed by ConvertToInlineShape. In other languages this throws an exception that the collection has been modified, here it just stops silently.

To avoid this you need to either add each shape to another collection and iterate over them there. Or in the case of the below sample just keep track of the index manually.

```
Sub InlineAllImages()

    Dim Shape As Shape
    Dim Index As Integer: Index = 1
    ' Store the count as it will change each time.
    Dim NumberOfShapes As Integer: NumberOfShapes = Shapes.Count

    ' Break out if either all shapes have been checked or there are none left. 
    Do While Shapes.Count > 0 And Index < NumberOfShapes + 1

        With Shapes(Index)
            If .Type = msoPicture Then
                ' If the shape is a picture convert it to inline.
                ' It will be removed from the collection so don't increment the Index.
                .ConvertToInlineShape
            Else
                ' The shape is not a picture so increment the index (move to next shape).
                Index = Index + 1
            End If
        End With

    Loop

End Sub

```
For i = 1 To ActiveDocument.Shapes.Count
ActiveDocument.Shapes(1).ConvertToInlineShape
'index value be 1 as the count will decrease on every conversion
Next