can anyone see what's wrong with this ?

J

JethroUK©

can anyone see what's wrong with this

it spose to iterate through all picture objects & cut n paste them back

it errors on the very first picture (item(1)) it finds

With ActiveDocument
If .Shapes.Count > 0 Then
With .Shapes
For x = 1 To .Count
.Item(x).Select
Selection.Cut
Selection.PasteAndFormat (wdPasteDefault) <<<<<<<<<<<
error here (on item 1)
Next
End With
End If
If .InlineShapes.Count > 0 Then
With .InlineShapes
For x = 1 To .Count
.Item(x).Select
Selection.Cut
Selection.PasteAndFormat (wdPasteDefault)
Next
End With
End If
End With
 
M

Mel_la_Bel

Hi there,

you should check that ActiveDocument is not equal to Nothing!
Also check if your count is greater than1, otherwise, if count == 0, the
For-Loop will crash. I suppose that's why it crashes.

Regards
Mel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top