|
楼主,请将图片统一缩放到适当大小后试用下面的宏:
- Sub test插入图片()
- Dim t As Table
- For Each t In ActiveDocument.Tables
- With t.Range
- .Cells(12).Range.InlineShapes.AddPicture FileName:="D:\K1" & Replace(Replace(.Cells(11).Range.Text, vbCr, ""), Chr(7), "") & ".jpg"
- .Cells(14).Range.InlineShapes.AddPicture FileName:="D:\K1" & Replace(Replace(.Cells(13).Range.Text, vbCr, ""), Chr(7), "") & ".jpg"
- .Cells(16).Range.InlineShapes.AddPicture FileName:="D:\K1" & Replace(Replace(.Cells(15).Range.Text, vbCr, ""), Chr(7), "") & ".jpg"
- .Cells(18).Range.InlineShapes.AddPicture FileName:="D:\K1" & Replace(Replace(.Cells(17).Range.Text, vbCr, ""), Chr(7), "") & ".jpg"
- End With
- Next
- End Sub
复制代码 |
|