I am a beginner in VBA. However, I have some programming experience.
I have a .docx file in which there is around 90 pictures. Unfortunately, those pictures have different styles.
I would like to write a macro in which I will go through all the pictures in a file and set their style into a specific one that I created in word. Let's call it "picture" style.

I wrote some part of code but VBA gives me an error which I do not understand.

Here is the code:
Sub ChangeStylePicture()
Dim i As Integer

For i = 1 To InlineShapes.Count
    If InlineShapes.Item(i).Type = wdInlineShapePicture Then
    InlineShapes.Item(i).Style = ActiveDocument.Styles("Picture")
    End If
    Next i
End Sub
VBA tells me that there is no variable defined in the loop, which I do not understand.

I will be very grateful for any tip how to deal with this problem or how to correct the code.