Foxtable(狐表)用户栏目专家坐堂 → [求助]外部引用msword问题


  共有1841人关注过本帖树形打印复制链接

主题:[求助]外部引用msword问题

帅哥哟,离线,有人找我吗?
witkeylaw
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:235 积分:2346 威望:0 精华:0 注册:2011/6/19 0:05:00
[求助]外部引用msword问题  发帖心情 Post By:2018/11/28 22:48:00 [显示全部帖子]

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


 回到顶部
帅哥哟,离线,有人找我吗?
witkeylaw
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:235 积分:2346 威望:0 精华:0 注册:2011/6/19 0:05:00
  发帖心情 Post By:2018/12/15 16:35:00 [显示全部帖子]

谢谢

 回到顶部