wps批量調整圖片大小

qingtianZzzzz發表於2020-12-15

啟用VB編輯器
點選右側Thisdocument
輸入以下程式碼後,執行
Sub setpicsize()
Dim i
Dim Height, Weight
Height = 500
Weight = 200
On Error Resume Next
For i = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes型別圖片
ActiveDocument.InlineShapes(i).Height = 250 '設定圖片高度為Height_px
ActiveDocument.InlineShapes(i).Width = 420 '設定圖片寬度Weight_px
Next i
For i = 1 To ActiveDocument.Shapes.Count 'Shapes型別圖片
ActiveDocument.Shapes(i).Height = Height '設定圖片高度為 Height_px
ActiveDocument.Shapes(i).Width = Weight '設定圖片寬度 Weight_px
Next i
End Sub

相關文章