Alt+F11/F8
這部分要說的是把word中的所有圖片按比例縮放!
具體操作同上,只是代碼部分稍做修改,代碼如下:
Sub setpicsize() '設置圖片大小
Dim n '圖片個數
Dim picwidth
Dim picheight
On Error Resume Next '忽略錯誤
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes 類型圖片
picheight = ActiveDocument.InlineShapes(n).Height
picwidth = ActiveDocument.InlineShapes(n).Width
ActiveDocument.InlineShapes(n).Height = picheight * 1.1 '設置高度為1.1倍
ActiveDocument.InlineShapes(n).Width = picwidth * 1.1 '設置寬度為1.1倍
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes類型圖片
picheight = ActiveDocument.Shapes(n).Height
picwidth = ActiveDocument.Shapes(n).Width
ActiveDocument.Shapes(n).Height = picheight * 1.1 '設置高度為1.1倍
ActiveDocument.Shapes(n).Width = picwidth * 1.1 '設置寬度為1.1倍
Next n
End Sub
Sub 圖片尺寸一起調()
'
' 圖片尺寸一起調 宏'
'
Mywidth = 15 '10為圖片寬度(厘米)
' Myheigth = 10 '10為圖片高度(厘米)
For Each iShape In ActiveDocument.InlineShapes
' iShape.Height = 28.345 * Myheigth
iShape.Width = 28.345 * Mywidth
Next iShape
End Sub