
Добавил:
Mehanik
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:0097 / 1
.txt Sub Макрос1()
Dim inshp As InlineShape
For Each inshp In ActiveDocument.InlineShapes
Select Case inshp.Type
Case 3, 4, 12, 13
If inshp.ScaleWidth <> 100 Then
inshp.Select
inshp.ScaleWidth = 200
inshp.ScaleHeight = 200
If inshp.Width > ColumnWidth(inshp) Then
inshp.Width = ColumnWidth(inshp)
inshp.ScaleHeight = inshp.ScaleWidth
End If
End If
End Select
Next inshp
End Sub
Public Function ColumnWidth(inshp As InlineShape) As Single
Dim l As Single, r As Single, p As Single
p = inshp.Range.PageSetup.PageWidth
l = inshp.Range.PageSetup.LeftMargin
r = inshp.Range.PageSetup.RightMargin
ColumnWidth = p - (l + r)
End Function
Dim inshp As InlineShape
For Each inshp In ActiveDocument.InlineShapes
Select Case inshp.Type
Case 3, 4, 12, 13
If inshp.ScaleWidth <> 100 Then
inshp.Select
inshp.ScaleWidth = 200
inshp.ScaleHeight = 200
If inshp.Width > ColumnWidth(inshp) Then
inshp.Width = ColumnWidth(inshp)
inshp.ScaleHeight = inshp.ScaleWidth
End If
End If
End Select
Next inshp
End Sub
Public Function ColumnWidth(inshp As InlineShape) As Single
Dim l As Single, r As Single, p As Single
p = inshp.Range.PageSetup.PageWidth
l = inshp.Range.PageSetup.LeftMargin
r = inshp.Range.PageSetup.RightMargin
ColumnWidth = p - (l + r)
End Function