|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
简单粗暴的写了一下,自己去加循环进行处理就行了:
Sub shishi()
Dim ip As InlineShape, ph$, f$
ph = ThisDocument.Path & "\问题清单照片存放处\"
f = "安全文明 空间斤斤计较斤斤计较.jpg"
Set rg1 = ActiveDocument.Tables(1).Range.Cells(6).Range
rg1.End = rg1.End - 1: rg1.Delete: rg1.Text = Mid(f, 1, 4)
Set rg2 = ActiveDocument.Tables(1).Range.Cells(8).Range
rg2.End = rg2.End - 1: rg2.Delete: rg2.Text = Left(f, InStr(f, ".") - 1)
Set rg3 = ActiveDocument.Tables(1).Range.Cells(7).Range
rg3.End = rg3.End - 1: rg3.Delete
w = ActiveDocument.Tables(1).Range.Cells(7).Width
h = ActiveDocument.Tables(1).Range.Cells(7).Width
Set ip = rg3.InlineShapes.AddPicture(ph & f, False, True)
ip.Height = h: ip.Width = w
End Sub |
|