![]() |
#1
|
|||
|
|||
![]()
Hello dears, hope you are all doing safe and sound!
i'm trying to find a way to insert images from links folder to word table and to be aligned with their names Before: ![]() After: ![]() i'm also attaching sample files for before and after along with links folder any help will be highly appreciated here Thanks in advance Cross-posting link |
#2
|
|||
|
|||
![]()
I suspect you wanted some images for before and after in your post. You can edit it. It would be the same process you used for your sample.zip.
How to attach a screenshot or file in this forum. You could then place your insertion point in the post to position the images. |
#3
|
|||
|
|||
![]()
sorry but i didn't get your point,
i have already inserted screenshots at the post to explain my request and the sample files are for testing the code to be sure it works well before posting it here. |
#4
|
|||
|
|||
![]()
I'm not understanding the point of Before and After in your post if not to show images.
Quote:
|
#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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
maxbaeten | Drawing and Graphics | 3 | 09-27-2017 11:34 PM |
![]() |
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 |
![]() |
WaltR | Word | 4 | 01-29-2011 11:22 PM |