![]() |
|
#5
|
|||
|
|||
|
Thanks to José Augusto
Solved Code:
Sub LinkImagesToTable()
'
Dim File_Path As String, Image_Path As String, Image_Name As String, Image_Aux As String, Row_i As Integer
On Error Resume Next
File_Path = ActiveDocument.Path
Image_Path = File_Path & "\Links"
For Row_i = 2 To ActiveDocument.Tables(1).Rows.Count
Image_Aux = ActiveDocument.Tables(1).Cell(Row_i, 1).Range
Image_Name = Trim(Left(Image_Aux, Len(Image_Aux) - 2) & ".jpg")
ActiveDocument.Tables(1).Cell(Row_i, 2).Select
Selection.Range = ""
ActiveDocument.Shapes.AddPicture(Anchor:=Selection.Range, FileName:= _
Image_Path & "\" & Image_Name, _
LinkToFile:=True, SaveWithDocument:=True).WrapFormat.Type = wdWrapSquare
DoEvents
Next Row_i
For Row_i = 1 To ActiveDocument.Shapes.Count
With ActiveDocument.Shapes(Row_i)
.RelativeHorizontalPosition = 2
.RelativeVerticalPosition = 1
.Top = 0
End With
DoEvents
Next Row_i
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to link images by default when dragging images in word
|
maxbaeten | Drawing and Graphics | 3 | 09-27-2017 11:34 PM |
Opening all selected images, resizing images and placing them into a table.
|
John Livewire | Word VBA | 1 | 09-15-2017 11:24 PM |
| Link cells in word doc (table) to update from 2 separate docs - can this be done? | larrens | Word | 3 | 09-15-2014 11:20 PM |
| exporting images with correct file names | lister | PowerPoint | 1 | 03-12-2014 12:27 AM |
Share your tips for centering images in table cells
|
WaltR | Word | 4 | 01-29-2011 11:22 PM |