1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub DVP_InsererLesImages()
aRepertoire$ = <TonRepertoireAToi>
Selection.GoTo What:=wdGoToTable, Which:=wdGoToAbsolute
For aI = 1 To ActiveDocument.Tables(1).Rows.Count
Selection.MoveRight Unit:=wdCell
If aI < 10 Then
aNomFichier$ = "00" + Trim(Str$(aI)) + "xxx.jpg"
ElseIf aI < 100 Then
aNomFichier$ = "0" + Trim(Str$(aI)) + "xxx.jpg"
Else
aNomFichier$ = Trim(Str$(aI)) + "xxx.jpg"
End If
Selection.InlineShapes.AddPicture FileName:=aRepertoire$ + aNomFichier$, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveRight Unit:=wdCell
Next
ActiveDocument.Tables(1).Rows(ActiveDocument.Tables(1).Rows.Count).Delete
End Sub |
Partager