title: Is there a method to use VBA to insert multiple images and insert them in order of selection through the dialog box?
body: <p>I'm creating multiple reports with a ton of images (50+ images). I need to insert them in a specific order. I have a running script which opens a Dialog box and I can select the photos that I want, but when I press OK, it inserts the images in alphabetical order. I want them to be inserted in the order I select them from the dialog box.</p>
  
  <p>I've tried to find methods relating to insertion methods in VBA. Nothing?</p>
  
  <pre><code>Sub InsertSelectedPixs()
  Dim fd As FileDialog
  Dim picPath As String
  Dim fnd As Variant
  Dim rep As Variant
  
  Set fd = Application.FileDialog(msoFileDialogFilePicker)
  
  Dim vrtSelectedItem As Variant
  
  With fd
  .InitialFileName = "*"
  .AllowMultiSelect = True
  .Filters.Clear
  .Filters.Add "Images", "*.png; *.jpg; *.jpeg; *.tif"
  
  If .Show = -1 Then
  
  For Each vrtSelectedItem In .SelectedItems
  Set MyPic = ActiveDocument.InlineShapes.AddPicture(vrtSelectedItem)
  picName = Right(vrtSelectedItem, Len(vrtSelectedItem) - InStrRev(vrtSelectedItem, "\"))
  
  MyPic.Select
  MyPic.LockAspectRatio = msoTrue
  MyPic.Width = CentimetersToPoints(7.25)
  Selection.MoveDown wdLine
  Selection.TypeText Chr(11)
  Selection.InsertCaption Label:="Figure", Title:=". " &amp; picName, Position:=wdCaptionPositionBelow
  Selection.Collapse wdCollapseEnd
  Selection.TypeText Chr(10)
  Next vrtSelectedItem
  
  Else
  End If
  End With
  
  Set fd = Nothing
  
  With ActiveDocument.Content.Find
  .Execute FindText:=".jpg", ReplaceWith:="", Format:=True, Replace:=wdReplaceAll
  End With
  
  ActiveDocument.Range(0, 0).Select
  Selection.WholeStory
  Dim oRange As Word.Range
  
  If ActiveDocument.Range.Tables.Count &lt;&gt; 0 Then Exit Sub
  
  Set oRange = ActiveDocument.Range
  
  oRange.ConvertToTable Separator:=wdSeparateByParagraphs, Format:=wdTableFormatGrid1, NumColumns:=2
  
  Set oRange = Nothing
  
  End Sub
  </code></pre>
  
  <p>The images get imported into the Word doc in alphabetical order rather than the selected order during the selection screen (file dialog box)</p>