Sub AfbeeldingenBijschrift()
Dim xFD As FileDialog
Dim vrtSelectedItem As Variant, arr As Variant
Dim xFile As String, xName As String, i As Integer
On Error Resume Next
Set xFD = Application.FileDialog(msoFileDialogFilePicker)
With xFD
.Filters.Add "Afbeeldingen", "*.png; *.jpg; *.jpeg", 1
.Filters.Add "RAW", "*.bmp; *.tif; *.tiff", 2
.InitialFileName = ActiveDocument.Path & "\"
.AllowMultiSelect = True
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
If xFile <> "" Then xFile = xFile & ";"
xFile = xFile & vrtSelectedItem
Next
If xFile = "" Then Exit Sub
End If
'Ingelezen bestanden verwerken
arr = Split(xFile, ";")
For i = LBound(arr) To UBound(arr)
xFile = arr(i)
xName = Split(arr(i), "\")(UBound(Split(arr(i), "\")))
With Selection
.InlineShapes.AddPicture xFile, False, True
.InsertAfter vbCrLf
.MoveDown wdLine
.Text = xName & Chr(10)
.MoveDown wdLine
End With
Next i
End With
End Sub