Word VBA to Cut/Paste inlineshape Suddenly Fails

19 Views Asked by At

I’m very new to VBAs so please bear with me. I created the below macro in word to find and replace all inlineshapes as pictures. It has been working fine for weeks but today it errors out when trying to paste cut/paste the third inlineshape. Why would this suddenly fail?

Dim i As Integer, oShp As    InlineShape
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
Set oShp = ActiveDocument.InlineShapes(i)
oShp.Select
Selection.Cut
Selection.PasteSpecial Link:=False, DataType:=15, _
    Placement:=wdInLine, DisplayAsIcon:=False
Next i

Other people I’ve sent the macro and document to can run it without issue.

0

There are 0 best solutions below