Adding picture into activedocument shapes

B

baha

Hi Everyone,
I have a following code for adding bmp pictures which are named from
1 to 250, into activedocument shapes which are named from image1 to
image250. It seems like I am doing something wrong.Any help?
My code is
Private Sub CommandButton1_Click()
Dim i As Variant
For i = 1 To 250
ActiveDocument.Shapes("Image" & i).OLEFormat.Object.Object.Picture =
LoadPicture(ThisDocument.Path & "\Pictures\" & i & ".BMP")
Next i
End Sub

Thanks in advance
Baha
 

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