ElCapitano
02-23-2022, 03:39 AM
So this code will put pictures from a specific folder in your word. You have any ideea how can i control where to put the pictures ? what I must change in the code...
Sub GetPictures()
Dim sPic As String
Dim sPath As String
sPath = "c:\myfolder"
sPic = Dir(sPath & "*.jpg")
Do While sPic <> ""
Selection.InlineShapes.AddPicture _
FileName:=sPath & sPic, _
LinkToFile:=False, SaveWithDocument:=True
sPic = Dir
Selection.TypeParagraph
Selection.TypeParagraph
Loop
End Sub
Sub GetPictures()
Dim sPic As String
Dim sPath As String
sPath = "c:\myfolder"
sPic = Dir(sPath & "*.jpg")
Do While sPic <> ""
Selection.InlineShapes.AddPicture _
FileName:=sPath & sPic, _
LinkToFile:=False, SaveWithDocument:=True
sPic = Dir
Selection.TypeParagraph
Selection.TypeParagraph
Loop
End Sub