You could use a macro to add the images. I assume that you are running the process from Excel, in which case you need something like the following to create a table at the end of the current document with two rows for each image listed in your worksheet. Enter the total number of images to include where indicated and the cell ranges that contain the image paths and caption texts as appropriate
Sub Macro1() Dim wdApp As Object Dim oDoc As Object Dim oRng As Object Dim oTable As Object Dim oCell As Object Dim i As Long, j As Long Dim oRow As Object On Error Resume Next Set wdApp = GetObject(, "Word.Application") If Err Then 'This part should not be necessary if the document is already open in Word. Set wdApp = CreateObject("Word.Application") End If On Error GoTo 0 Set oDoc = wdApp.ActiveDocument Set oRng = oDoc.Range oRng.Collapse 0 oRng.InsertParagraphBefore Set oTable = oDoc.Tables.Add(Range:=oRng, _ NumRows:=2, _ NumColumns:=1, _ DefaultTableBehavior:=1, _ AutoFitBehavior:=0) Set oRow = oTable.Rows(1) Set oCell = oRow.Cells(1).Range oCell.End = oCell.End - 1 oCell.Text = "Image 1" 'Replace from Excel 'oCell.InlineShapes.AddPicture _ FileName:="path of first image from Excel", _ LinkToFile:=False, _ SaveWithDocument:=True Set oRow = oTable.Rows(2) Set oCell = oRow.Cells(1).Range oCell.End = oCell.End - 1 oCell.Text = "Caption 1" 'Replace from Excel For i = 2 To 12 '12 being the number of images from Excel If i Mod 1 = 0 Then oTable.Rows.Add oTable.Rows.Add End If j = oTable.Rows.Count Set oRow = oTable.Rows(j - 1) Set oCell = oRow.Cells(1).Range oCell.End = oCell.End - 1 oCell.Text = "Image " & i 'Replace from Excel 'oCell.InlineShapes.AddPicture _ FileName:="path of next image from Excel", _ LinkToFile:=False, _ SaveWithDocument:=True Set oRow = oTable.Rows(j) Set oCell = oRow.Cells(1).Range oCell.End = oCell.End - 1 oCell.Text = "Caption " & i 'Replace from Excel Next i End Sub




Reply With Quote