Довольно часто (например, при загрузке в Word HTML-документа) возникает задача одним махом отформатировать картинки, выпирающие за пределы экрана.
Вот простенький макрос, решающий эту задачу:
Sub ImageResize()
Dim oShape As InlineShape
Dim wmas As Integer
Application.ScreenUpdating = False
Documents(1).Activate
wmax = ActiveDocument.PageSetup.PageWidth - ActiveDocument.PageSetup.LeftMargin - ActiveDocument.PageSetup.RightMargin - 1
For Each oShape In ActiveDocument.InlineShapes
oShape.Select
If oShape.Width > wmax Then
oShape.Width = wmax
End If
Next
Application.ScreenUpdating = True
End Sub
Вот простенький макрос, решающий эту задачу:
Sub ImageResize()
Dim oShape As InlineShape
Dim wmas As Integer
Application.ScreenUpdating = False
Documents(1).Activate
wmax = ActiveDocument.PageSetup.PageWidth - ActiveDocument.PageSetup.LeftMargin - ActiveDocument.PageSetup.RightMargin - 1
For Each oShape In ActiveDocument.InlineShapes
oShape.Select
If oShape.Width > wmax Then
oShape.Width = wmax
End If
Next
Application.ScreenUpdating = True
End Sub