我有一张每天都会更新的图片幻灯片,通常其他用户都错误地添加了它们。这意味着我必须调整大小,重新定位并添加轮廓,以满足这些演示文稿的定义标准。
我找到了一个宏,可以根据选择来调整所有图像的大小
Sub Imagesize
Dim oshp As Shape
Dim oPic As Shape
Dim picH As Single
Dim picW As Single
Dim osld As Slide
If ActiveWindow.Selection.Type = ppSelectionNone Then GoTo err
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then GoTo err
Set oshp = ActiveWindow.Selection.ShapeRange(1)
For Each osld In ActivePresentation.Slides
For Each oPic In osld.Shapes
If oPic.Type = msoPicture Then
picW = oPic.Width
picH = oPic.Height
oPic.LockAspectRatio = True
oPic.Width = oshp.Width
oPic.Left = oPic.Left - (oshp.Width - picW) / 2
oPic.Top = oPic.Top - (oshp.Height - picH) / 2
End If
If oPic.Type = msoPlaceholder Then
If oPic.PlaceholderFormat.ContainedType = msoPicture Then
picW = oPic.Width
picH = oPic.Height
oPic.LockAspectRatio = True
oPic.Width = oshp.Width
oPic.Left = oPic.Left - (oshp.Width - picW) / 2
oPic.Top = oPic.Top - (oshp.Height - picH) / 2
End If
End If
Next oPic
Next osld
Exit Sub
err:
MsgBox "Please select ONE shape and retry!", vbCritical
End Sub
它可以完美地工作,但是没有人知道是否可以添加任何东西来使图像水平19厘米,垂直4厘米吗?
好吧,请回答我自己的问题。这是两个脚本,但可以!不理我!
—
Trip Treebly
与其说您回答了自己的问题,不如说一条评论,最好是发布一个回答说如何解决问题的答案。
—
Mokubai