How to use VBA inlineshape to disable overlay of pictures

288 Views Asked by At

The word document have many pictures. The pictures should show one pre page. Normally I just need to select them all to insert. All of them will occupy in good order one picture per page.

However, sometimes, word overlay them together. Resulting only one page with many pictures stacking up each other.

I find some VBA script that change the scale of pictures. I want to change that to disable overlap of pictures or change the wrap settings of them.

Dim i As Long
With ActiveDocument
    For i = 1 To .InlineShapes.Count
        With .InlineShapes(i)
            .ScaleHeight = 50
            .ScaleWidth = 50
        End With
    Next i
End With

How to change the above script to disable them overlay each other ?

1

There are 1 best solutions below

1
macropod On

As John says:

If pictures are stacked or overlapping, they are not inline with text.

You can correct that with code like:

With ActiveDocument
    Do While .Shapes.Count > 0
        .Shapes(1).ConvertToInlineShape
    Loop
End With