1、批量设置图片大小,红色部分出错,请问如何处理。
2、代码
Dim app As New MSWord.Application
try
Dim fileName = "E:\test.docx"
Dim doc As object = app.Documents.Open(fileName)
Dim ishape As msword.InlineShape
For Each ishape In app.ActiveDocument.InlineShapes
' ishape.LockAspectRatio = msoCTrue
' If ishape.Type = msword.wdInlineShapePicture Then
If ishape.height > 400
ishape.height = 450
Else
If ishape.Width > 250 Then
ishape.Width = 480
Else
ishape.Width = 238
End If
End If
' End If
Next
MsgBox("done")
app.visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
finally
End try