VBA

 

 

  1. 调整图片亮度减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
    

      

  2. 调整对比度加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
    

      

  3. 宽度统一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
    

      

  4. 高度统一 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
    

      

 

posted @ 2018-07-29 13:13  徐锅  阅读(280)  评论(0编辑  收藏  举报