Dim app As New MSWord.Application
try
Dim fileName = "D:\问题\temp\变电所命名及开关柜编号.docx"
Dim doc As object = app.Documents.Open(fileName)
Dim img = "D:\问题\temp\背景2.jpg" '图片路径
Dim Top As Integer = 0
Dim left As Integer = 0
Dim w As Integer = 0
Dim h As Integer = 0
For Each a As object In doc.Shapes
Top = a.Top
left = a.left
w = a.width
h=a.height
Output.Show(a.Top)
Output.Show(a.left)
a.delete
Next
Dim s = doc.Shapes.AddPicture(img, False, True,Top ,left ,w,h)
s.WrapFormat.Type = MSWord.WdWrapType.wdWrapBehind
Doc.save
catch ex As exception
msgbox(ex.message)
finally
app.Quit
End try