VBA
- 调整图片亮度减10%:
Sub 调整全部图片亮度() ' ' 调整全部图片亮度 宏 ' ' Application.ScreenUpdating = False Dim a As Integer Dim pic As InlineShape Dim aBorder As Border a = ActiveDocument.InlineShapes.Count If a = 0 Then MsgBox ("没有发现嵌入式图片") End If For Each pic In ActiveDocument.InlineShapes pic.PictureFormat.IncrementBrightness -0.05 '降亮度 Next Application.ScreenUpdating = True End Sub
- 调整对比度加10%
Sub 对比度加十() ' ' 对比度加十 宏 ' ' Application.ScreenUpdating = False Dim a As Integer Dim pic As InlineShape Dim aBorder As Border a = ActiveDocument.InlineShapes.Count If a = 0 Then MsgBox ("没有发现嵌入式图片") End If For Each pic In ActiveDocument.InlineShapes pic.PictureFormat.IncrementContrast 0.05 '增对比度 Next Application.ScreenUpdating = True End Sub
- 宽度统一17厘米
Sub 调整宽度17() ' ' 调整宽度17 宏 ' ' Application.ScreenUpdating = False Dim a As Integer Dim pic As InlineShape Dim aBorder As Border a = ActiveDocument.InlineShapes.Count If a = 0 Then MsgBox ("没有发现嵌入式图片") End If For Each pic In ActiveDocument.InlineShapes pic.Width = 482 '宽度固定 Next Application.ScreenUpdating = True End Sub
- 高度统一 11厘米
Sub 调整高度11() ' ' 调整高度11 宏 ' ' Application.ScreenUpdating = False Dim a As Integer Dim pic As InlineShape Dim aBorder As Border a = ActiveDocument.InlineShapes.Count If a = 0 Then MsgBox ("没有发现嵌入式图片") End If For Each pic In ActiveDocument.InlineShapes pic.Height = 312 '高度固定 Next Application.ScreenUpdating = True End Sub