调整word图片大小自适应页面宽度的VBA
(2016-05-23 21:52:15)调整word图片大小自适应页面宽度的VBA
1.图片宽度小于页面宽度的保持不变。
2.图片宽度大于页面宽度的,图片宽和高按比例缩小至宽度与页面宽度一致。
3.图片缩小时高宽比保持不变。
4.按照要求调整word文档下所有图片。
来自showship http://tieba.baidu.com/p/3718667061
Sub suoxiaopicture()
pw = ActiveDocument.PageSetup.PageWidth -
ActiveDocument.PageSetup.LeftMargin -
ActiveDocument.PageSetup.RightMargin
Dim oInlineShape As InlineShape
For Each oInlineShape In ActiveDocument.InlineShapes
With oInlineShape
If .Width > pw Then
.Width = pw
End If
End With
Next
End Sub
前一篇:[转载]小偏方:桑叶水洗头治脱发

加载中…