ElCapitano
02-23-2022, 01:43 AM
Hello,guys
You have any ideas why this code doesn't work? Is to put pictures into a word document from a specific folder... Thanks...
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
You have any ideas why this code doesn't work? Is to put pictures into a word document from a specific folder... Thanks...
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