Wiki ЖБК

Материалы для проектирования железобетонных конструкций

Инструменты пользователя

Инструменты сайта


пакетная_wod

Пакетная обработка изображений в Word

Макрос на VBA, который изменяет размер выбранных изображений до 65% и увеличивает яркость на 10%:

Sub Dannoff()
Dim pic As InlineShape, w!, h!, i&, n$, b As Boolean
With Application
    b = .DisplayStatusBar
    .DisplayStatusBar = True
    .ScreenUpdating = False
End With
n = " из " & Selection.InlineShapes.Count
For Each pic In Selection.InlineShapes
    i = i + 1
    Application.StatusBar = "Работаем с картинкой " & i & n
    If pic.Type = wdInlineShapeHorizontalLine Then
        pic.Delete
    Else
        pic.PictureFormat.Brightness = 0.6
        If pic.Height > 30 Then
            With pic
                w = .Width
                h = .Height
                .Width = w * 0.65
                .Height = h * 0.65
            End With
        End If
    End If
Next
With Application
    .DisplayStatusBar = b
    .ScreenUpdating = True
End With
End Sub

Взято отсюда: http://forum.ixbt.com/topic.cgi?id=23:42008

Макрос на VBA, который увеличивает яркость до +20%:

Sub brightness()
    Dim pic As InlineShape, w!, h!, i&, n$, b As Boolean
    With Application
        b = .DisplayStatusBar
        .DisplayStatusBar = True
        .ScreenUpdating = False
    End With
    n = " из " & Selection.InlineShapes.Count
    For Each pic In Selection.InlineShapes
        i = i + 1
        Application.StatusBar = "Работаем с картинкой " & i & n
        pic.PictureFormat.brightness = 0.6
    Next
    With Application
        .DisplayStatusBar = b
        .ScreenUpdating = True
    End With
End Sub

Обсуждение

Ваш комментарий:
   ___    _  __ ______
  / _ \  | |/_//_  __/
 / , _/ _>  <   / /   
/_/|_| /_/|_|  /_/
 
PDF Export Download this page as a pdf Text Export Download this page as a plain text
пакетная_wod.txt · Последнее изменение: 2015-04-23 13:41 — swell

Инструменты страницы