Dear All,

I am new to VBA. Can any one answer me the below queries

I have a set of images in a folder which needs to be converted into a single pdf using vba or using vba into the word document.

1. I was trying to paste all the images in each page of a word document using vba but instead of each page, images are automatically getting pasted in the first page itself.

2. Please also tell me how to convert and save such files in the word document.

Thanks in Advance.

Find below my code.

Sub CollateWorkbooks()
Dim MyPath As String
Dim strFilename As String
Dim i As Integer
'Dim fromTop As Integer
'fromTop = 5
Application.DisplayAlerts = False
Application.ScreenUpdating = False
MyPath = "C:\Users\user\Desktop\New folder" ' change to suit
strFilename = Dir(MyPath & "\*.jpg", vbNormal)
If Len(strFilename) = 0 Then Exit Sub
Do Until strFilename = ""
ActiveDocument.Shapes.AddPicture FileName:=MyPath & "\" & strFilename, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=-5, _
top:=5, _
Width:=300, _
Height:=150
strFilename = Dir()
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1
'fromTop = fromTop + 160
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub